-
Notifications
You must be signed in to change notification settings - Fork 36
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
switch from setuppy to pyprojecttoml #214
switch from setuppy to pyprojecttoml #214
Conversation
💥 I've removed Not sure what's the best way to resolve this, we could:
... found a workaround after some thinking -> using a dummy |
pyproject.toml
Outdated
|
||
dependencies = [ | ||
"semver~=3.0", | ||
"build", |
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.
Is "build"
a new dependency? I'm not familiar with that, but I noticed it wasn't listed in the old requirements.txt.
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.
build is required for packaging. Should not be in normal deps. I'll fix that.
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.
is it a new requirement? Was it required in the past? I'm not familiar with it.
I didn't see it listed in requirements or optional_requirements from before and the packaging was always working properly as far as I understand.
Is there some other specific change within this PR that makes this module now a requirement? Or was it always required and being installed in some other way before?
If you upgrade the version of pylint in Re |
we definately should, this thing already started unraveling like a sweater with |
I think we will want to keep |
In our library repos they use an entry inside of pyproject.toml to make it check requirements.txt and optional_requirements.txt files https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/blob/69b6e97c93d94231a8e37b9dfee424bc1608e630/pyproject.toml#L45-L46 is it possible to do that same thing in this repo? that would make this consistent with the library repos. |
🎉 I've managed to fix the ci by
Keeping requirements in |
Personally I am in favor of keeping the requirements.txt files how they were before. It may be more elegant to hardcode them in pyproject.toml and then make this fake version of Also if I am understanding correctly wouldn't having requirements.txt faked mean that running Maybe further down the line it could make sense to do a wholesale switch away from using requirements.txt if there are better solutions. But IMO for the time being the consistency of having this repo be the same as all the others is preferable. |
This reverts commit 41ed0d2.
You have a point there. I've changed PR accordingly. |
Note that
with no effect. Documentation says this fuctionality is BETA btw. |
We discussed the If you'd still like to share it there are a few options for that:
If you do publish it in one of these ways let you could propose a link to that be added to the documentation, or if you're interested in writing out a bit more about what it is, how to use it, and how it makes development easier you could even write a Playground page in the Learn guide system. If you'd like to just use it in your local instance and add it to your local .gitigore as well and then it'll stay in your local copy of the repo but not be checked in. I'm intending to test this out and take a closer look at the pyproject.toml changes this weekend. If you see this message before that, and have the chance to add a commit that removes the .devcontainer you can do that. No worries if not though I can add a commit if the "allow maintainers to edit" check was enabled, or make a new branch from this and create a separate PR if not. |
Sure, I've removed devcontainer for now. The devcontainer verision is on |
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.
@sjev Thank you for working on this!
I think this is close, but will need a bit more work for the version and pypi deployment actions.
Currently when you install from this branch it installs as version 0.0.0
. But when you installed from currently released branch it will fill in a version closer to the real one (but perhaps not exact, it tries to increment and find the 'next' version)
One possible solution for this seems to be adding:
[tool.setuptools_scm]
Into pyproject.toml. The documentation here: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#dynamic-metadata mentions about dynamic
:
Currently the following fields can be listed as dynamic: version, classifiers, description, entry-points, scripts, gui-scripts and readme. When these fields are expected to be provided by setuptools a corresponding entry is required in the tool.setuptools.dynamic table [2].
There is some more info on setuptools-scm usage here: https://setuptools-scm.readthedocs.io/en/latest/usage/
I tested that locally and it does seem to allow the version to get filled in successfully. I'm not certain if that is the best solution or not.
The workflows files seem to still be making references to setup.py in a few spots. I'm wondering if those might cause trouble without further changes because it looks like they are checking for the existence of setup.py
to control some of the actions tasks.
The workflows also still use python setup.py sdist
here:
https://github.com/adafruit/circup/blob/main/.github/workflows/release.yml#L38C6-L38C30
Which is noted as deprecated here: https://packaging.python.org/en/latest/discussions/setup-py-deprecated/#is-setup-py-deprecated
So I think we'll want to find the non-deprecated new way to do that and update the workflows file.
Another thing I think worth considering at this time is what minimum version of Python we want to continue supporting. Right now this is listing 3.6, but that is EoL and no longer maintained version of Python, so I learn towards us dropping support for it in circup as well. I'll try to get input on this during the next meeting.
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.
We discussed minimum version support during the meeting and came to the consensus of support 3.9 as the minimum, though 3.8 does have security releases for a few more months, if we have user(s) pop up trying to use on 3.8 maybe we can lower it for a bit.
I have pushed commits to change the versions in these files, as well as bumped to a newer version of python inside the actions container for build actions. I've updated the release.yml action config as well to a version that should support pyproject.toml I believe. It was taken from the config used by the majority of circuitpython libraries, but tweaked slightly since the version automation works differently in this repo.
I think this is looking good at this point. I believe everything that I noted in prior comments is handled now.
Thanks again for working on this.
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.
Actually not quite ready yet. The new release action seems to be failing https://github.com/adafruit/circup/actions/runs/9357375764 also it's kind of strange that it's even running, I think I've done something wrong in it.
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.
Okay, I think the release action should be good now.
I think the one that I had used before was not intended to be used directly as an action but rather called in using the with
syntax. I ended up copying the one from circuitpython-build-tools and tweaking a py version and the build command.
If this works I'll make a PR over on build-tools with the same tweaks.
Closes #189
Changes:
setup.py
topyproject.toml
dev
extra list used for development and building..devcontainer
for reproduceable dev environment in VSCodeNotes
python -m build
, however I'm not sure that automatic versioning withsetuptools-scm
works correctly.ci script is broken (need to fix before merge). See comment further on..pylint.rc
could be consolidated topyprojecct.toml
, this is something to consider. Curent.pylint.rc
is a bit long though.