Skip to content

Removed unused runtime dependencies setuptools and toml #340

Closed

Description

@rolweber

Version 3.1.5 from PyPI declares dependencies on setuptools and toml:

Requires-Dist: setuptools (>=47.0.0)
Requires-Dist: toml (>=0.10.0,<0.11.0)

However, I found no reference to these dependencies in the installed code that comes with the package.

Are these dependencies leftovers from a time when EnvironmentParser (setuptools) and PoetryParser (toml) were still part of this codebase? Can they be dropped now?

Activity

  1. jkowalleck commented on Jan 13, 2023

    @jkowalleck
    Member

    Thanks for the report, @rolweber
    evidece: the sdist release contains the following

    install_requires = \
    ['packageurl-python>=0.9',
     'setuptools>=47.0.0',
     'sortedcontainers>=2.4.0,<3.0.0',
     'toml>=0.10.0,<0.11.0']

    caused by https://github.com/CycloneDX/cyclonedx-python-lib/blame/main/pyproject.toml#L47

  2. jkowalleck commented on Jan 13, 2023

    @jkowalleck
    Member

    Can they [unused runtime dependencies] be dropped now?

    Probably. Need to check the actual usage of the packages.
    setuptools ships two python packages: setuptools and pkg_resources.
    toml ships only on package: toml.

    @rolweber would you create a pull request and change things to the behavior you'd expect?
    If so, please keep our contribution guidelines in mind.

  3. added
    good first issue
    help wanted
    on Jan 13, 2023
  4. rolweber commented on Jan 13, 2023

    @rolweber
    ContributorAuthor

    Evidence:

    1. I grepped for the package names, see below.
    2. I removed the dependencies in question and was still able to build a BOM and output it as JSON.

    ls -l cyclonedx*

    cyclonedx:
    total 12
    drwxr-xr-x. 1 rolweber rolweber   98 Jan 13 11:29 exception/
    drwxr-xr-x. 1 rolweber rolweber   64 Jan 13 11:29 factory/
    -rw-r--r--. 1 rolweber rolweber  697 Jan 13 11:29 __init__.py
    drwxr-xr-x. 1 rolweber rolweber  260 Jan 13 11:29 model/
    drwxr-xr-x. 1 rolweber rolweber  108 Jan 13 11:29 output/
    drwxr-xr-x. 1 rolweber rolweber   44 Jan 13 11:29 parser/
    drwxr-xr-x. 1 rolweber rolweber   84 Jan 13 11:29 __pycache__/
    -rw-r--r--. 1 rolweber rolweber  153 Jan 13 11:29 py.typed
    drwxr-xr-x. 1 rolweber rolweber  488 Jan 13 11:29 schema/
    -rw-r--r--. 1 rolweber rolweber 2071 Jan 13 11:29 spdx.py
    
    cyclonedx_python_lib-3.1.5.dist-info:
    total 36
    -rw-r--r--. 1 rolweber rolweber     4 Jan 13 11:29 INSTALLER
    -rw-r--r--. 1 rolweber rolweber 11357 Jan 13 11:29 LICENSE
    -rw-r--r--. 1 rolweber rolweber  5878 Jan 13 11:29 METADATA
    -rw-r--r--. 1 rolweber rolweber  6075 Jan 13 11:29 RECORD
    -rw-r--r--. 1 rolweber rolweber     0 Jan 13 11:29 REQUESTED
    -rw-r--r--. 1 rolweber rolweber    88 Jan 13 11:29 WHEEL

    grep -r setuptools cyclonedx*

    cyclonedx_python_lib-3.1.5.dist-info/METADATA:Requires-Dist: setuptools (>=47.0.0)

    grep -r pkg_resources cyclonedx*

    There's a _distutils_hack package in setuptools...
    grep -r distutils cyclonedx*

    grep -r toml cyclonedx*

    cyclonedx_python_lib-3.1.5.dist-info/METADATA:Requires-Dist: toml (>=0.10.0,<0.11.0)
  5. rolweber commented on Jan 13, 2023

    @rolweber
    ContributorAuthor

    There are references to toml and setuptools in pyproject.toml, poetry.lock, and requirements.lowest.txt. Also some comments regarding types-setuptools, which is supposed to be kept in sync with setuptools, but actually isn't (version 57 vs 47). As I am not familiar with poetry, your project setup looks very intricate and intimidating to me.

  6. jkowalleck commented on Jan 13, 2023

    @jkowalleck
    Member

    To be honest, the situation is not critical to me as a maintainer.
    Therefore, I do not intend to work on this soon.

    So this is free for everyone who has a problem with the current situation. Feel free to raise a pull request to improve this library.
    If so, please keep our contribution guidelines in mind. I will be happy to assist, if needed.

  7. added this to the 4.0.0 milestone on Mar 7, 2023
  8. self-assigned this
    on Mar 7, 2023
  9. changed the title [-]Unused runtime dependencies?[/-] [+]Removed unused runtime dependencies `setuptools` and `toml`[/+] on Mar 7, 2023
  10. madpah commented on Mar 20, 2023

    @madpah
    Collaborator

    Included in 4.0.0 - now released.

  11. added a commit that references this issue on Mar 20, 2023
  12. added a commit that references this issue on Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issuehelp wanted

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions