-
Notifications
You must be signed in to change notification settings - Fork 15
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
256 all configs within pyprojecttoml for a streamlined build experience #271
256 all configs within pyprojecttoml for a streamlined build experience #271
Conversation
This reverts commit 5ea9a0b.
This reverts commit f2189d9.
… requirements.txt and requirements-dev.txt. Update CONTRIBUTING.rst to explain
…scipy==1.10.1 depends on Python>=3.8,<3.12
version = "1.3.1" | ||
dependencies = [ | ||
"pandas>=1.5.0", | ||
"scikit-learn>=1.2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah - answered my own question by seeing that you install directly from the pyproject file.
OK, I think that this PR is close.
try:
__version__ = version("tubular")
except PackageNotFoundError:
# package is not installed
pass (you need to remove the import of
With these parameters in place, we can draw the tag version from git and use that to define package version: $ git tag v2.1.0 #Not a tag in our repo - for illustration
$ python -m build # From within the tubular root dir
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
- setuptools >= 61.0
- setuptools-scm[toml]>=6.0
- wheel
* Getting build dependencies for sdist...
[ ... ]
Successfully built tubular-2.1.1.dev0+g3942b60.d20240719.tar.gz and tubular-2.1.1.dev0+g3942b60.d20240719-py3-none-any.whl
$ ls dist/*
dist/tubular-2.1.1.dev0+g3942b60.d20240719-py3-none-any.whl dist/tubular-2.1.1.dev0+g3942b60.d20240719.tar.gz (the extra stuff (I tried the above build without Otherwise, it looks good. |
Thanks Adam. Must have rushed this a bit because I thought I had removed setup.py already! Done here: 1e0bbf1 also intended to remove setuptools-scm form this PR and add in a follow up but I have got it working in this commit: 1e0bbf1 As a knock on of this I have removed logic in base.py that set a self.version attribute. Can do this with importlib but this attribute doesnt get used anywhere as far as i can tell so I removed to declutter a bit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A good simplification of the package and good foundations of the next change.
I tried creating a package via the tag mechanism and it worked. We do have to rather hope that the CD process holds, but such is the way with these things often.
Approved.
…treamlined-build-experience
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapproved after Merge Conflict fixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
third time is a charm - _version crept back in there.
Draft of moving all project configs to pyproject.toml
moved into pyrpoject.toml:
deleted:
Haven't
yetgot rid of requirements.txt or requirements-dev.txt.requirements-dev.txt because still using pip in the devcontainer set up and I'm not sure how to get pip to install deps from pyproject.toml dependency spec. Edit: now understand this could simply be done with
pip install .[dev
] in this case. Keeping pinned requirments-dev.txt as a fixed developer environment is still handy to have.requirements.txt because it seems like build still wants it to exist separately from pyproject.toml which I find strange and frankly I'm quite sure I am missing something.
Might just move over to poetry for env managment and build to resolve the above.Moved to using pip-tools workflow, defining requirments.txt and requirements.dev by running pip compile on requirements specified in pyproject.toml which resolves the above nicely.
Doing so and fixing the versions of all dependencies has revealed an incompatibility between specified packages and python 3.12:
scipy==1.10.1 depends on Python>=3.8,<3.12
. Previously scipy was not specified in requirements so presumably a later version of the package was picked up when installing in python 3.12.Now changed to install dependiencies from pyproject.toml in build pipeline so it creates a compatible build for each python version and will flag on scheduled run if this is not possible.
It is possible to specify different package sepec depending on python version in pyproject.toml example but pip-tools pip-compile will not run for multiple versions of python or even a different version to the one it is run in.