tern-tools / tern

Tern is a software composition analysis tool and Python library that generates a Software Bill of Materials for container images and Dockerfiles. The SBOM that Tern generates will give you a layer-by-layer view of what's inside your container in a variety of formats including human-readable, JSON, HTML, SPDX and more.
BSD 2-Clause "Simplified" License
967 stars 188 forks source link

Install with setup.py bug #1084

Closed vsoch closed 2 years ago

vsoch commented 3 years ago

Describe the bug I'm creating a package for spack, and we cannot install with the traditional setup.py build because package metadata is missing in te setup.py. I am wondering if it would be possible to add?

To Reproduce Steps to reproduce the behavior:

  1. Download .tar.gz from pypi
  2. build
# This is run from spack, python 3.8.12
python -s setup.py --no-user-cfg' build

4 errors found in build log:
  >> 4     /home/vanessa/Desktop/Code/spack-dev/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/py-setuptools-58.2.0-eky5ahqa
           ys44qh7gkwtp2amv6a34oue2/lib/python3.8/site-packages/setuptools/dist.py:717: UserWarning: Usage of dash-separate
           d 'author-email' will not be supported in future versions. Please use the underscore name 'author_email' instead
     5       warnings.warn(
  >> 6     /home/vanessa/Desktop/Code/spack-dev/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/py-setuptools-58.2.0-eky5ahqa
           ys44qh7gkwtp2amv6a34oue2/lib/python3.8/site-packages/setuptools/dist.py:717: UserWarning: Usage of dash-separate
           d 'long-description' will not be supported in future versions. Please use the underscore name 'long_description'
            instead
     7       warnings.warn(
  >> 8     /home/vanessa/Desktop/Code/spack-dev/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/py-setuptools-58.2.0-eky5ahqa
           ys44qh7gkwtp2amv6a34oue2/lib/python3.8/site-packages/setuptools/dist.py:717: UserWarning: Usage of dash-separate
           d 'long-description-content-type' will not be supported in future versions. Please use the underscore name 'long
           _description_content_type' instead
     9       warnings.warn(
  >> 10    /home/vanessa/Desktop/Code/spack-dev/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/py-setuptools-58.2.0-eky5ahqa
           ys44qh7gkwtp2amv6a34oue2/lib/python3.8/site-packages/setuptools/dist.py:717: UserWarning: Usage of dash-separate
           d 'home-page' will not be supported in future versions. Please use the underscore name 'home_page' instead
     11      warnings.warn(

Error in terminal

see above! I pre-emptively pasted :laughing:

Expected behavior Normally setup.py build should be successful.

Environment you are running Tern on

Ubuntu 20.04, no containers! Python 3.8.12

Thank you!

rnjudge commented 3 years ago

Hi @vsoch - thanks for the issue. We use the setup.cfg file to house our package metadata. Are you able to pull the info from there?

vsoch commented 3 years ago

@rnjudge based on the error message, I do think the install is using setup.cfg (sorry for not realizing this) and the issue is that the fields are deprecated. E.g., here is the long-description: https://github.com/tern-tools/tern/blob/38d5c7664d41b5163a5a88662824bac13e7db8a3/setup.cfg#L12 which should be renamed to long_description.

vsoch commented 3 years ago

I can open a quick PR to test updating these metadata fields.

vsoch commented 3 years ago

Suggested change! https://github.com/tern-tools/tern/pull/1085

vsoch commented 2 years ago

Thank you for this help! Tern is now added to spack, so people can try out install via there, or if interested in Docker/Singularity containers there is a containerize command to do the same and generate in a dockerfile, or modules too. https://github.com/spack/spack/pull/27599#event-5701960443