You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can some of the runtime dependencies be loosened? #44
I know poetry makes it easy lock every little thing down, and it makes testing easier, higher assurance, yadda yadda, but practically, it's quite inflexible when the effective ranges are very small... and on a self-declared lib to boot.
Specifically, hooray for declaring a setuptools dependency: so many pkgutils-using packages forget to.
However the size of the range covered by setuptools ^50.3.2 makes it relatively hard to appease (as in: exactly 1 version).
Selfishly, this is blocking me downstream in packaging this and ultimately jake 1.x for conda-forge.
The same goes for importlib_metadata which unfortunately gets pinned in a number of packages, and seems to change a lot for a backport package.
Anyhow: would the maintainers be open to a PR that:
loosened the range of e.g. setuptools to be something more like >=50.3.2,<59
added a CI test excursion for the lowest and highest bound
In the meantime, I may try patching the pin over on conda-forge and running the full test suite...
Welp, it looks like test suite passes locally with setuptools 58.3.2 with 93% coverage... i haven't dug into whether the missing lines are setuptools-relevant, but seems like a good sign:
test_bom_metadata_tool_multiple_tools (test_bom.TestBom) ... ok
test_bom_metadata_tool_this_tool (test_bom.TestBom) ... ok
test_bom_simple (test_bom.TestBom) ... ok
test_as_package_url_1 (test_component.TestComponent) ... ok
test_as_package_url_2 (test_component.TestComponent) ... ok
test_as_package_url_3 (test_component.TestComponent) ... ok
test_custom_package_url_type (test_component.TestComponent) ... ok
test_from_file_with_path_for_bom (test_component.TestComponent) ... ok
test_full_purl_spec_no_subpath (test_component.TestComponent) ... ok
test_get_component_by_purl_1 (test_component.TestComponent) ... ok
test_has_component_1 (test_component.TestComponent) ... ok
test_purl_correct (test_component.TestComponent) ... ok
test_purl_incorrect_name (test_component.TestComponent) ... ok
test_purl_incorrect_version (test_component.TestComponent) ... ok
test_purl_with_qualifiers (test_component.TestComponent) ... ok
test_json_defaults (test_e2e_environment.TestE2EEnvironment) ... ok
test_xml_defaults (test_e2e_environment.TestE2EEnvironment) ... ok
test_hash_type_from_composite_str_1 (test_model.TestModel) ... ok
test_hash_type_from_composite_str_2 (test_model.TestModel) ... ok
test_empty_basic_component (test_model_component.TestModelComponent) ... ok
test_external_references (test_model_component.TestModelComponent) ... ok
test_multiple_basic_components (test_model_component.TestModelComponent) ... ok
test_v_rating_scores_all (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_rating_scores_base_only (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_rating_scores_empty (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_severity_from_cvss_scores_multiple_critical (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_severity_from_cvss_scores_multiple_high (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_severity_from_cvss_scores_single_critical (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_severity_from_cvss_scores_single_high (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_severity_from_cvss_scores_single_low (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_severity_from_cvss_scores_single_medium (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_severity_from_cvss_scores_single_none (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_get_localised_vector_cvss2_1 (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_get_localised_vector_cvss2_2 (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_get_localised_vector_cvss2_3 (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_get_localised_vector_cvss3_1 (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_get_localised_vector_cvss3_2 (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_get_localised_vector_cvss3_3 (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_get_localised_vector_other_1 (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_get_localised_vector_other_2 (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_get_localised_vector_owasp_1 (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_get_localised_vector_owasp_2 (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_get_localised_vector_owasp_3 (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_parse_cvss2_1 (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_parse_cvss3_1 (test_model_vulnerability.TestModelVulnerability) ... ok
test_v_source_parse_owasp_1 (test_model_vulnerability.TestModelVulnerability) ... ok
test_get_instance_default (test_output_generic.TestOutputGeneric) ... ok
test_get_instance_xml (test_output_generic.TestOutputGeneric) ... ok
test_get_instance_xml_v1_3 (test_output_generic.TestOutputGeneric) ... ok
test_bom_v1_3_with_component_external_references (test_output_json.TestOutputJson) ... ok
test_bom_v1_3_with_component_hashes (test_output_json.TestOutputJson) ... ok
test_bom_v1_3_with_component_license (test_output_json.TestOutputJson) ... ok
test_simple_bom_v1_2 (test_output_json.TestOutputJson) ... ok
test_simple_bom_v1_3 (test_output_json.TestOutputJson) ... ok
test_bom_v1_3_with_component_external_references (test_output_xml.TestOutputXml) ... ok
test_bom_v1_3_with_component_hashes (test_output_xml.TestOutputXml) ... ok
test_simple_bom_v1_0 (test_output_xml.TestOutputXml) ... ok
test_simple_bom_v1_0_with_vulnerabilities (test_output_xml.TestOutputXml) ... ok
test_simple_bom_v1_1 (test_output_xml.TestOutputXml) ... ok
test_simple_bom_v1_2 (test_output_xml.TestOutputXml) ... ok
test_simple_bom_v1_3 (test_output_xml.TestOutputXml) ... ok
test_simple_bom_v1_3_with_vulnerabilities (test_output_xml.TestOutputXml) ... ok
test_with_component_license (test_output_xml.TestOutputXml) ... ok
test_conda_list_explicit_md5 (test_parser_conda.TestCondaParser) ... ok
test_conda_list_json (test_parser_conda.TestCondaParser) ... ok
test_simple (test_parser_environment.TestEnvironmentParser)
@todo This test is a vague as it will detect the unique environment where tests are being executed - ... ok
test_simple (test_parser_pipenv.TestPipEnvParser) ... ok
test_with_multiple_and_no_index (test_parser_pipenv.TestPipEnvParser) ... ok
test_simple (test_parser_poetry.TestPoetryParser) ... ok
test_example_1 (test_parser_requirements.TestRequirementsParser) ... ok
test_example_multiline_with_comments (test_parser_requirements.TestRequirementsParser) ... ok
test_example_with_comments (test_parser_requirements.TestRequirementsParser) ... ok
test_example_with_hashes (test_parser_requirements.TestRequirementsParser) ... skipped 'Not yet supported'
test_example_without_pinned_versions (test_parser_requirements.TestRequirementsParser) ... ok
test_simple (test_parser_requirements.TestRequirementsParser) ... ok
test_parse_conda_json_no_hash (test_utils_conda.TestUtilsConda) ... ok
test_parse_conda_list_str_no_hash (test_utils_conda.TestUtilsConda) ... ok
test_parse_conda_list_str_with_hash_1 (test_utils_conda.TestUtilsConda) ... ok
test_parse_conda_list_str_with_hash_2 (test_utils_conda.TestUtilsConda) ... ok
test_parse_conda_list_str_with_hash_3 (test_utils_conda.TestUtilsConda) ... ok
----------------------------------------------------------------------
Ran 80 tests in 0.250s
OK (skipped=1)
Do we have a collective view as to how to handle CI for when we loosen dependency versions @jkowalleck? Doesn't seem like there is anything OOTB in Poetry to cover us here.
requirements_parser Appears not to be used and can be removed?
packageurl-python
We use PackageURL class
Looks like this class has been present with the same signature since the packages first release 0.3.0 (package-url/packageurl-python@bd63e2d) based on the date of this commit
toml
We use loads from toml
Tough to determine a safe lowest version - suggest we start with ^0.10.0
typing-extensions Can stay as defined?
types-setuptools
First release was 57.0.0 - suggest we allow all versions?
great research, @madpah
now we could lower the requirements to the versions actually needed. :-)
at some point we should have CI to test once in latest/highest compatible setup, and once in lowest compatible setup.
issue i see: there is no way to setup lowest compatible environment
i mean, we run tests in a virtual environment (via tox) anyways, so we can downgrade some installs (setuptools, etc) and install dependencies in specific versions. that should be no issue.
but how could this be done, unless python-poetry/poetry#3527 was implemented ?
nevertheless, we might lower the dependencies, still.
tests for "lowest" can be added later. there are no tests for it now, and there is no proper way to do it at the moment, or is there? @madpah what are your thoughts regarding tests? iwe might have a hand-crafted option - see #44 (comment)
Do we have a collective view as to how to handle CI for when we loosen dependency versions @jkowalleck? Doesn't seem like there is anything OOTB in Poetry to cover us here.
could not find anything.
since we discuss direct dependencies at this point of view, we could do the following:
from pyproject.toml i found our direct dependencies:
which in turn could be installed in a CI/tox setup right after poetry install installed its needed tools.
something like pip install -r requirements.lowest.txt will do
this way we would have the lowest versions available
@madpah lets see if we like the setup i built, and if we can fix it.
then we would have a test bed in which we could lower the dependencies as planned.
Activity
bollwyvl commentedon Oct 30, 2021
Welp, it looks like test suite passes locally with
setuptools 58.3.2with 93% coverage... i haven't dug into whether the missing lines aresetuptools-relevant, but seems like a good sign:https://github.com/conda-forge/staged-recipes/pull/16672/files#diff-3ac673913839cd48ed24c8f39f820bfaa5df9d6882b981e978d022ef548d0869R6
Some more logs will appear here:
https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=400079&view=logs&j=6f142865-96c3-535c-b7ea-873d86b887bd
jkowalleck commentedon Nov 7, 2021
did a quick lookup which parts of
setuptoolsare actually used:pkg_resources.working_set,pkg_resources.DistInfoDistributionpkg_resources.parse_requirements(),pkg_resources.Requirementdid i miss something?
should be possible to go down to v47.0.0 - this is the version where py2 support was removed.
what do you think, @madpah ?
tested with a modified
pyproject.tomland ran this in the venv:pip install poetry poetry install -v pip install -U setuptools==47.0.0 python3 -m unittest discover -s tests -vvtest result:
Click to expand test results
jkowalleck commentedon Nov 7, 2021
@madpah in preparation for this change I would recommend:
madpah commentedon Nov 9, 2021
Happy to proceed with this - and thanks @bollwyvl for calling this out.
We'll get #59 merged first and then get the deps loosened up.
jkowalleck commentedon Nov 9, 2021
might be related: python-poetry/poetry#3527
madpah commentedon Nov 19, 2021
Just waiting on #71 / #68 before we loosen deps.
jkowalleck commentedon Nov 20, 2021
i reejected #71 / #68
@madpah feel free to go ahead.
madpah commentedon Nov 23, 2021
Thanks @jkowalleck.
Do we have a collective view as to how to handle CI for when we loosen dependency versions @jkowalleck? Doesn't seem like there is anything OOTB in Poetry to cover us here.
madpah commentedon Nov 23, 2021
Packages to consider:
madpah commentedon Nov 23, 2021
@jkowalleck already researched
setuptools- proposing we allow down to47.0.0and up to latest (59.2.0)madpah commentedon Nov 23, 2021
importlib_metadata
metadataandversionfromimportlib_metadatametadataimplementation looks to be unchanged since0.13(python/importlib_metadata@647cf3b)versionimplementation looks to be unchanged since0.13(python/importlib_metadata@647cf3b)requirements_parser
Appears not to be used and can be removed?
packageurl-python
PackageURLclass0.3.0(package-url/packageurl-python@bd63e2d) based on the date of this committoml
loadsfromtoml^0.10.0typing-extensions
Can stay as defined?
types-setuptools
57.0.0- suggest we allow all versions?types-toml
toml?@jkowalleck - thoughts on above?
jkowalleck commentedon Nov 23, 2021
great research, @madpah
now we could lower the requirements to the versions actually needed. :-)
at some point we should have CI to test once in latest/highest compatible setup, and once in lowest compatible setup.
issue i see: there is no way to setup lowest compatible environment
i mean, we run tests in a virtual environment (via tox) anyways, so we can downgrade some installs (setuptools, etc) and install dependencies in specific versions. that should be no issue.
but how could this be done, unless python-poetry/poetry#3527 was implemented ?
nevertheless, we might lower the dependencies, still.
tests for "lowest" can be added later. there are no tests for it now, and there is no proper way to do it at the moment, or is there?
@madpah what are your thoughts regarding tests? iwe might have a hand-crafted option - see #44 (comment)
jkowalleck commentedon Nov 23, 2021
could not find anything.
since we discuss direct dependencies at this point of view, we could do the following:
from
pyproject.tomli found our direct dependencies:so we could have a
requirements.lowest.txtwith the following contentwhich in turn could be installed in a CI/tox setup right after
poetry installinstalled its needed tools.something like
pip install -r requirements.lowest.txtwill dothis way we would have the lowest versions available
jkowalleck commentedon Nov 23, 2021
prepared a setup as descibed: #79
@madpah lets see if we like the setup i built, and if we can fix it.
then we would have a test bed in which we could lower the dependencies as planned.
5 remaining items
madpah commentedon Dec 9, 2021
Indeed - will update and lower back to 3.4.0.
madpah commentedon Dec 9, 2021
#89 has been merged.
madpah commentedon Dec 9, 2021
@bollwyvl - sorry this has taken a little while to organise, but we've just released 0.12.0 which has loosened the dependency versions significantly.
Would appreciate your feedback!
feat: widen more dependencies
feat: widen more dependencies
feat: Loosed dependency versions to make this library more consumable
feat: Loosed dependency versions to make this library more consumable
bollwyvl commentedon Dec 9, 2021
feat: Loosed dependency versions to make this library more consumable
fix: further loosened dependency definitions
bollwyvl commentedon Dec 9, 2021
Yep, was able to ship 0.12.0 without any patches, and all the tests passed the first time, just the way we likes it! Thanks again.
madpah commentedon Dec 15, 2021
That's epic @bollwyvl. Thanks for confirming.
We've of course pushed a few tweaks since 0.12.0 as we've worked through a few niggles - but good to know this is now solved for you.