Skip to content
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

Removed unused runtime dependencies setuptools and toml #340

Closed
rolweber opened this issue Jan 13, 2023 · 6 comments
Closed

Removed unused runtime dependencies setuptools and toml #340

rolweber opened this issue Jan 13, 2023 · 6 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@rolweber
Copy link
Contributor

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?

@jkowalleck
Copy link
Member

jkowalleck commented Jan 13, 2023

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

@jkowalleck
Copy link
Member

jkowalleck commented Jan 13, 2023

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.

@jkowalleck jkowalleck added good first issue Good for newcomers help wanted Extra attention is needed labels Jan 13, 2023
@rolweber
Copy link
Contributor Author

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)

@rolweber
Copy link
Contributor Author

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.

@jkowalleck
Copy link
Member

jkowalleck commented Jan 13, 2023

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.

@madpah madpah added this to the 4.0.0 milestone Mar 7, 2023
@madpah madpah self-assigned this Mar 7, 2023
@madpah madpah changed the title Unused runtime dependencies? Removed unused runtime dependencies setuptools and toml Mar 7, 2023
@madpah
Copy link
Collaborator

madpah commented Mar 20, 2023

Included in 4.0.0 - now released.

@madpah madpah closed this as completed Mar 20, 2023
jkowalleck added a commit that referenced this issue Mar 20, 2023
Signed-off-by: Jan Kowalleck <[email protected]>
madpah pushed a commit that referenced this issue Mar 21, 2023
Signed-off-by: Jan Kowalleck <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants