Additional features for pip dependencies: uniform logging, private repos and comes_from info #116
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.
Hello, in our project we have been using Medikit for a while, but we were missing some features which were useful for us. With this aim, we created a fork. These changes are now included in this PR for discussion, improvement, and ideally for potential inclusion in your main project if you find them useful.
Added features
These are the newly added features:
Uniform dependencies
Due to the nature of our project, we wanted to have different dependencies for different extras, but in some cases, we needed to have the same versions for all the extras. With this aim, we have added the parameter
python.use_uniform_requirements
. WhenTrue
, for a certain requirement, finds a valid version for all the extras using it (including inherited requirements) and sets all of them for all the requirements*.txt files implied. We are not consideringsetup.py
for this feature, to keep some flexibility after the process.Addition of private repositories
It is now possible to use private repositories using git, for instance including in the python
add_requirements
something like:requirement @ git+ssh://[email protected]/user_name/requirement_2.git@{checkpoint_or_tag}
, which will be then translated into equivalent requirements in the setup.py and requirements*.txt files. More informationShow the requirement which inherits a certain requirement
Just a visualization feature. When
python.show_comes_from_info
is True, presents a comment with the generated requirements, indicating the requirement which caused the installation of a dependency, to understand better the changes.Extended information
New parameters provided:
python.use_uniform_requirements
: If True, requirements are set to be the same for all the extras when there are coincidences, directly or on the inherited dependencies.python.show_comes_from_info
: If True, information about the origin of a dependency is shown.Valid requirement examples:
Projectfile usage example:
use_uniform_requirements== True
, requirement versions will be unified among all the extras.NOTE: In case a private repository version is mixed with a different version from another repository, or even with
a packaged version (included inherited versions), an IncompatibleRequirements exception will be triggered.
For instance, the example above will become:
We hope you find these features interesting. Waiting for your comments.