-
Notifications
You must be signed in to change notification settings - Fork 112
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
build: migrate to pyproject.toml #1068
Merged
Merged
Changes from 22 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
47f8537
Remove obsoleted files.
tonyandrewmeyer c942cc7
Organise the build files together and ensure that version.py doesn't …
tonyandrewmeyer a160ce8
Migrate data from setup.py.
tonyandrewmeyer a0feaeb
Exclude some files from the sdist.
tonyandrewmeyer 0d18f51
Update the dependency location.
tonyandrewmeyer 0b8f710
Remove auto-generated file.
tonyandrewmeyer b58abed
Update with email address.
tonyandrewmeyer edca060
Move the requirements into pyproject.toml.
tonyandrewmeyer 9fedd2e
Remove outdated tests.
tonyandrewmeyer 66b8057
Use build to create the distribution package.
tonyandrewmeyer 96d0c39
Update build command.
tonyandrewmeyer 183ff1a
Add pinned versions of requirements files.
tonyandrewmeyer 3790aa4
Add dev dependencies.
tonyandrewmeyer 54a471e
Add type hint now that the default value is gone.
tonyandrewmeyer 412b68a
Provide instructions for generating the doc requirements.
tonyandrewmeyer 2ce49c1
Fix spacing around import.
tonyandrewmeyer 063abdc
Ensure that the requirements are kept in sync. Ensure version.py exists.
tonyandrewmeyer c856db6
Ensure setuptools-svm is available to generate the version.py file.
tonyandrewmeyer e4d41a7
Add setuptools to the dev dependencies so that the version.py file ca…
tonyandrewmeyer 5a921a6
Extend the information on tooling.
tonyandrewmeyer 3ad12d0
Don't bundle the .gitignore, that's just for when you have a clone.
tonyandrewmeyer e9f0cb6
Merge branch 'main' into pyproject-build-893
tonyandrewmeyer 2947d92
Remove the setuptools-scm dependency.
tonyandrewmeyer fc47085
Merge branch 'main' into pyproject-build-893
tonyandrewmeyer 993892d
Tell setuptools where to find the version.
tonyandrewmeyer 3190143
We need the dependencies installed to import ops to get the version.
tonyandrewmeyer 3fe6176
Explicitly list the files to include (no longer using setuptools-scm).
tonyandrewmeyer 20ca414
Pin using Python 3.8.
tonyandrewmeyer adde28f
Merge branch 'main' into pyproject-build-893
tonyandrewmeyer 2a50930
Merge branch 'main' into pyproject-build-893
tonyandrewmeyer 71cedc2
Update HACKING.md
tonyandrewmeyer 3b7c10a
Update HACKING.md
tonyandrewmeyer e6a23c3
Bump pyright version to match main's requirements-dev.txt value.
tonyandrewmeyer 7f32a09
Address review comments.
tonyandrewmeyer 9edc6fc
Fix smoke name.
tonyandrewmeyer 339740d
Style fix.
tonyandrewmeyer 556d139
requirements-dev is now not used.
tonyandrewmeyer b6837c9
Per code review.
tonyandrewmeyer 0d726d9
Bump to next expected version.
tonyandrewmeyer 50b6386
Fix the manifest to pick up the correct files.
tonyandrewmeyer 1560224
Update HACKING.md for latest changes.
tonyandrewmeyer fadd413
Move to putting the dev dependencies direclty in tox.ini.
tonyandrewmeyer e1be35e
Minor cleanup after change to deps in tox.ini.
tonyandrewmeyer 06de826
Merge branch 'main' into pyproject-build-893
tonyandrewmeyer 8867b1d
Ensure there is a requirements file for readthedocs to use - and it's…
tonyandrewmeyer 84fcb74
Update pyproject.toml
tonyandrewmeyer 99ae4ee
Update tox.ini
tonyandrewmeyer 18db4e5
Regenerate using Python 3.8
tonyandrewmeyer c9c325d
Do a local install for rtd.
tonyandrewmeyer File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
recursive-exclude .github/ | ||
recursive-exclude docs/ | ||
exclude .readthedocs.yaml | ||
exclude .gitignore | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 wonder -- should/could we make these tox actions, rather than having the developer manually install pip-compile and enter these commands (also below)?
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.
It's only required when you actually want to bump a dependency, but yes a tool is likely better.
We could have it like this instead, avoiding any lock file at all:
The biggest issue is that if the dependencies change, pip doesn't pick up on that, and you generally have to blow away the .tox/env folder, which is not much better than running a command.
We could have the dev dependencies in
tox.ini
, particularly since they're being spilt out, and especially if we don't group many of them (or if there is a way to say "use this same dependency list for multiple envs", other than having them in another file). One advantage of having them in standard places is that tools (like security scanners) easily find them, though, and I'm not sure if they would there.Or I can just do as you suggest and we keep the generated files (probably not in version control, per a different thread) and I can add a
tox -e update-deps
(name to be bikesheded later).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.
Just having the
.[unit]
styledeps
value intox.ini
is no good - it avoids needing any compilation of what's inpyproject.toml
but the failure to pick up on changes is too inconvenient.In terms of speed (I did these 3 times and picked the median - not super accurate, but should be enough to spot order-of-magnitude differences), for a full
tox
:However, most of the time is (thankfully!) in the tests. For a quick env, like
lint
:I did some more investigation, and dependabot will find dependencies in
pyproject.toml
without having a lock file committed, but won't find them in tox.ini. Other tools seem mixed, but as far as I know we aren't using any at the moment, so I guess we could address that when/if that changes.I don't want to be significantly slower than current main. So that eliminates having both the
pip-compile
andpip-sync
intox.ini
.Having the dependencies in
optional-dependencies
sections inpyproject.toml
is recommended in some places and in others it seems like that's used only for optional features rather than dev dependencies. Being able to do a local install withpip install .[static,unit]
is nice, but it seems like the vast majority of the time people will be usingtox
, and doingpip install ops[unit]
doesn't seem like it's of use. Having requirements files generated seems inconvenient if we're not using them for anything else.So, on balance, I think putting them directly in
tox.ini
is the cleanest for now, and we can reconsider this if the scanning issue ever comes up.Except for the docs: readthedocs doesn't have tox, so we do need to have a generated
requirements.txt
file for there.