-
Notifications
You must be signed in to change notification settings - Fork 14
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
🔧 Add direct dependencies file: requirements.in #73
Open
ebouchut
wants to merge
6
commits into
nightscout:dev
Choose a base branch
from
ebouchut:config/git_and_python_packages
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
EDIT: moved to PR description. |
ebouchut
force-pushed
the
config/git_and_python_packages
branch
2 times, most recently
from
October 2, 2024 18:25
1b43f95
to
ee51aa3
Compare
- Freeze sphinx-copybutton version number. - Normalize package names to use dashes (-) as separators between words in the package name. This is the canonical format for package names on PyPI.
The direct dependencies ("top level packages") must now be listed in `requirements.in. We should now use `pip-compile` to create `requirements.txt`. pip-compile ` pip-compile` reads `requirements.in` to generate `requirements.txt` with the pinned direct and indirect dependencies. The `pip-compile` program is part of the `pip-tools` package. We need to install it first: python -m pip install pip-tools IMPORTANT: Do not to add packages/dependencies directly into `requirements.txt` but in `requirements.in`.
Install the development dependencies before other dependencies: # First: Install dev dependencies python -m pip install -r dev-requirements.txt # Next: Install production dependencies/packages python -m pip install -r requirements.txt
ebouchut
force-pushed
the
config/git_and_python_packages
branch
from
October 3, 2024 08:27
ee51aa3
to
1070588
Compare
@MikePlante1 I'd rather have your review approval for this one. |
28 tasks
marionbarker
previously approved these changes
Oct 27, 2024
@marionbarker |
marionbarker
previously approved these changes
Oct 27, 2024
…ies file Update wording to use `package` instead of `plugin`
@MikePlante1 |
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.
Here is a proposal to make it easier to create and add dependencies, and to be alerted to security issues in the packages we use.
Why?
The goal is:
requirements.txt
).requirements.in
.requirements.txt
Today, when using a single file with all dependencies (
requirements.txt
), I find it difficult to spot the direct dependencies (sphinx, sphinx-copybutton, sphinx-rtd-theme, myst-parser
) in an ocean of indirect dependencies.So, I suggest using 2 files.
How?
requirements.txt
to have 2 files:requirements.in
containing only the direct dependenciesrequirements.txt
containing the exhaustive list of all dependencies (direct and indirect). Today it does not contain the latter.pip-compile
lists below each dependencies its sub-dependencies.pip-compile
(from thepip-tools
package) to generaterequirements.txt
fromrequirements.in
.pip-compile
reads a source filerequirements.in
to generate arequirements.txt
with all the dependencies. It resolves and pins the dependencies to the ad-hoc version, ensuring reproducibility. It only focuses on dependencies declared in the source file.pip freeze
uses all packages installed in the virtual environment.Install
We need to install
pip-tools
first to usepip-compile
:Usage
Using
pip-compile
:pip-compile
only looks at the source file (requirements.in
), whereaspip freeze
looks at what is currently installed in the virtual environment.Previously, with
pip
: