I am trying to get some package metadata (name, version) given a path to the source directory without installing said package.
These work, using setup.py
if you're sitting in the root directory:
> python3 setup.py --name
my_package_name
> python3 setup.py --version
0.1.0
However, I have been cautioned away from using python3 setup.py
commands -- and indeed see a warning:
.../lib/python3.7/site-packages/setuptools/installer.py:30: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
SetuptoolsDeprecationWarning,
I know pip show my_package_name
will print various metadata about a package (including name/version), however it requires that the package is installed into the environment. It also doesn't take a source directory and thus requires I already know the name of the package I want the info on.
> pip show .
WARNING: Package(s) not found: .
> pip show my_package_name
WARNING: Package(s) not found: my_package_name
> pip install .
...
> pip show my_package_name
Name: my_package_name
Version: 0.1.0
...
...
Is there any equivalent pip
command (or other tool) that will show me the version of a package given the source directory without actually installing the package?
Thanks in advance!
from Get python3 package metadata given source directory without installing
No comments:
Post a Comment