-
Notifications
You must be signed in to change notification settings - Fork 1
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 distribution packages #3
Merged
Merged
Conversation
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
Since opda is a library rather than an application, it is more accurate to speak of releases rather than deployments.
The environment and concurrency group used in release.yml are intended to handle all release-related tasks, so update their names to reflect this intention.
Artifacts made with actions/upload-artifact default to 90 retention days. In contrast, actions/upload-pages-artifact defaults to 1 retention day. Increase the retention days from 60 to 90 so that the github-pages artifact will be retained for the same amount of time as other artifacts from the same workflow run.
Move the definition of the lint session before the definition of the docs session so that their order is consistent everywhere: the noxfile source, the default session order, and the order in the continuous integration workflow (build.yml).
The optional dependencies are frequently installed in nox sessions and continuous integration. Thus, it is beneficial to have each set of optional dependencies be minimal for the desired use case. Only the notebooks (nbs) and testing (tests) optional dependencies require the experiments package. It can be removed from the rest. After removing the experiments package from the documentation (docs) dependencies, matplotlib must be added back in, as it is no longer included transitively.
Rename the "tests" optional dependency to "test" so that it matches the nox session's name to reduce confusion. Similarly, reorder the optional dependencies to match the nox sessions' order.
Some code, like the experiments package, is only intended for use in the research behind opda. Such code is valuable to keep in this repository so that the research can be reproduced; however, it is not useful to distribute that code to end-users who only want to use the methods. Thus, split the local and distribution package builds for these two different use cases. Implement this split using comments in the pyproject.toml file. Each line ending in a `# build: local-only` comment should be removed before building the distribution package. Similarly, everything after the header: `# -- build: local-only -----` should be removed. Using these comments, the distribution package's pyproject.toml file can be constructed with simple text processing. For example, using awk: awk \ '/# -- build: local-only --/ {exit} !(/# build: local-only/) {print}' \ pyproject.toml Even using this mechanism to exclude the experiments package, setuptools will still include the source for it in the sdist. So, also create a MANIFEST.in file intended solely for the distribution package and adapt pyproject.toml to make sure it builds the local and distribution packages correctly (excluding all local-only files from the distribution package's sdist and wheel).
a7448f5
to
74249f1
Compare
Tests for the project, including local-only code like the experiments package, should be run frequently. Tests for distribution packages should be run against all supported combinations of dependencies. Thus, testing distribution packages is expensive and should be run less frequently. For this reason, it makes sense to split the "test" nox session into two sessions: "test" for testing the whole project, and "testpackage" for testing distribution packages. Similarly, split the "test" job in build.yml into corresponding "test" and "testpackage" jobs. Finally, update the default nox sessions to reflect these changes.
The generic name, docs, is more immediately obvious and less tied to the infrastructure we happen to use for the project.
74249f1
to
bea4e39
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Update the packaging, add a nox session, and create continuous integration jobs to build the distribution package for opda.