-
Notifications
You must be signed in to change notification settings - Fork 3
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
Porting to pyproject.toml #6
Conversation
Should we add tests for this? How do we add tests for this? It would be good to have a test that "pretends" to be a user, goes through the options and checks the end result is installable, and that bump2version etc work. Is there a clever way to do something like this? |
It would be nice to have tests, it seems you can pass a config file (https://cookiecutter.readthedocs.io/en/1.7.2/advanced/user_config.html?highlight=config) to avoid the CLI input interface. Would have to use subprocess() a lot but I think this is okay: subprocess cookiecutter XXX + use config file [note: testing pre-commit testing bump2version?] |
I am trying to install the repo at this branch and I am having issues in ubuntu. I run Was the |
Issue solved thanks to IRL Joe assistance 🤣️ I misunderstood how to install the current cookiecutter. |
Based on this page it seems that some fields have changed name when moving from |
@JoeZiminski good job, I think you made the right calls.
|
I tested my comment above. I pip installed Warning: could not use pyproject.toml, using default configuration.
Reason: /home/niko/Code/wazp/pyproject.toml does not contain a tool.setuptools_scm section.
/home/niko/anaconda3/envs/zoo/lib/python3.10/site-packages/setuptools_scm/config.py:61: UserWarning: relative_to is expected to be a file, its the directory '.'
assuming the parent directory was passed
warnings.warn(
('ERROR: no version found for', Namespace(root=None, config=None, strip_dev=False, command=None)) |
I now fixed the Outstanding issue: I think currently |
My understanding is that to use both tools,
I haven't used setuptools_scm though, so this could be incorrect. |
What I don't currently understand is whether the current
|
I saw from the last commits we are not supporting python 3.7 in pyproject.toml |
Tests now pass ✅ but deploy is skipped ⌽ |
@lauraporta that's intended. deploy should only run on a tagged commit. The idea is to use bump2version to change the version number, and create a tagged commit. When this is pushed, it triggers deployment (as long as the tests pass). |
@lauraporta, these things have been added to the manifest, but do we actually want them in the built package? They aren't used when installed. I think they can be excluded, and check-manifest will be equally happy.
|
I am expanding the README.md file in this branch since it will include details relative on the changes present here. @adamltyson, I asked check-manifest and it seems not happy, but maybe I am using it wrongly.
|
The manifest lists what files should and shouldn't end up in the built package (python files and some others end up there by default). It's suggesting files are added to the manifest, but we don't need those files in the built package, so I think |
setuptools_scm is working now. Its a bit of a pain as we discussed, to have to lookup the most recent version from git-tags, and manaully imput the version number, and remember to However, it is nice to not have to worry about anything hard-coded in the project, and it avoids any worries of the bump2version and setuptools_scm diverging. |
all CI is passing, but I see |
I think those warnings are from the actions we use, and it's up to those authors to (hopefully) update things. |
@adamltyson I encountered the same |
@JoeZiminski re versioning. I think we just need to document really well and explicitly the |
So the |
* [black](https://black.readthedocs.io/en/stable/) for code structure formatting (maximum line length set to 79) | ||
* [flake8](https://flake8.pycqa.org/en/latest/) to enforce [PEP8](https://www.python.org/dev/peps/pep-0008/) | ||
* [mypy](https://mypy.readthedocs.io/en/stable/index.html) a static type checker | ||
* [isort](https://pycqa.github.io/isort/) sorts imports alphabetically |
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.
I don't think it's an alphabetical sort, it is much smarter than that
``` | ||
|
||
**Automated versioning** | ||
## Automated versioning |
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.
This version should be now re-written for setuptools_scm, perhaps Joe can help
Is this ready to review? As previously suggested, we should work on the docs in a seperate branch/PR. |
OK I make a separate branch for the docs |
I have taken the bold step to resolve the merge conflict and finally merge this giant PR. We'll resolve the remaining documentation issues in other branches. |
PR to port setup.cfg functionality from setup.cfg to pyproject.toml due to planned depreciation of setup.cfg.
For the most part the corresponding arangement is clear, but not for all, and for some things I am not certain what the command are actually doing so would be good to get feedback. Currently the whole process
then
pip install -e .[dev]
install without issue (windows 10, in pycharm, conda env).Name, version, author, author email, url, license, description, long_rescription, classifiers straightforward move
long_description_content_type
I think is depreciated, all I could find on it was from here:project urls seem a straightforward move, but I dont think spaces are not supported. Is this lowercase format an issue?
[Zip safe depreciated ](Add zip_safe support python-poetry/poetry#928 zip_safe obsolete)so removed
the two things I am quite unsure of,
requires
and updated the version based on here and here . This builds okay with pip, but I am not sure what is going on under the hood and when it may failOverall it runs okay for me, but not sure if there are other use cases we need to test.