-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add helper API #378
base: main
Are you sure you want to change the base?
Add helper API #378
Conversation
Codecov Report
@@ Coverage Diff @@
## master #378 +/- ##
=========================================
- Coverage 89.88% 84.79% -5.1%
=========================================
Files 27 28 +1
Lines 1186 1269 +83
Branches 214 235 +21
=========================================
+ Hits 1066 1076 +10
- Misses 84 157 +73
Partials 36 36
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #378 +/- ##
==========================================
+ Coverage 84.37% 84.79% +0.41%
==========================================
Files 28 28
Lines 1338 1269 -69
Branches 240 235 -5
==========================================
- Hits 1129 1076 -53
- Misses 146 157 +11
+ Partials 63 36 -27
Continue to review full report at Codecov.
|
49d745a
to
5468a1d
Compare
5468a1d
to
a7c8486
Compare
I've updated these functions to be slightly simpler and I moved them to I'm also trying out a slightly expanded version of these tools in another PR: |
@jcfr I was thinking about this PR and it's fit with scikit-build. I was thinking tools like this might be suitable for a more pure-python focused package, the name that popped in my head was scikit-setup. The main problem with setuptools (and pkg_resources) is that their requirements parser doesn't actually work correctly. While this could be patched in setuptools, it might make sense to have a lighter-weight less monolithic helper library for writing I'm also fairly unhappy with current versioning tools like versioneer, and I feel like there could be a better solution. Of course the risk is that this is yet-another-setup-library, but the goal here isn't to replace setuptools/poetry/pipenv/pyproject.toml (I don't know what the current accepted standard is, if there is one), but instead just provide a few simple functions that are useful during setup, namely I want to be able to write: version=parse_version('ubelt/__init__.py'),
long_description=parse_description(),
install_requires=parse_requirements('requirements/runtime.txt'),
extras_require={
'all': parse_requirements('requirements.txt'),
'tests': parse_requirements('requirements/tests.txt'),
'optional': parse_requirements('requirements/optional.txt'),
'docs': parse_requirements('requirements/docs.txt'),
}, I want to ensure that specifications of dependencies / versions are not repeated anywhere. I'd also like to provide a "strict" mode for dependency installs that would effectively replace any ">=" in the requirements specs with "==", which I currently do with an external script. Probably wont act on this anytime soon, but just writing down my thoughts while they are fresh. |
As a scikit, scikit-build should strive to make its target area of science simpler. However, unlike other scikits like learn and image, there isn't much of a top-level API. Designing a good top-level "build" API for Python is something that doesn't yet exist. Scikit-build has an opportunity to be the first tool that actually makes writing a
setup.py
script simple.As such I wanted to propose a few baseline functions to populate the currently singular API. These functions are contained in a file
helper_api.py
. The top of that file contains a docstring detailing a use-case that illustrates the usefulness of these API calls. All of these API calls serve the purpose of making it easier to fill out arguments tosetuptools.setup
.The API calls are:
packages
version
long_description
easierinstall_requires
easierI've currently been copy+pasting these 200ish lines of code between all of my repos, but it seems to me that scikit-build might be the right place for this logic to actually live.
I've exposed the functions in the
utils
subpackage. I'm not sure where these are best placed in the directory structure, so I'm open to ideas / suggestions here.