Skip to content

Commit 37375d2

Browse files
committed
Address review comments
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent 1ba7601 commit 37375d2

File tree

8 files changed

+7319
-456
lines changed

8 files changed

+7319
-456
lines changed

CHANGELOG.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,43 @@
11
Changelog
22
=========
33

4-
v0.6.6
4+
5+
v0.7.0
56
------
6-
- Add --insecure option to compute arguments.
7+
8+
- Enable live evaluation of the "setup.py" that use computed arguments.
9+
When this occurs, a live evaluation of the Python code is the only working
10+
solution short of a full installation. Because this can be a security issue,
11+
there is a new "--analyze-setup-py-insecurely" command line option to enable this feature.
12+
Note that this not more insecure than actually installing a PyPI package.
13+
714

815
v0.6.5
916
------
1017

1118
- Add --version option.
1219

20+
1321
v0.6.4
1422
------
1523

1624
- Add support for setup.py
1725

26+
1827
v0.6.3
1928
------
2029

2130
- Ensure to filter out top level dependencies on the basis of their environment markers
2231
- Do not ignore files on basis of name
2332

33+
2434
v0.6.2
2535
------
2636

2737
- Ignore invalid requirement files on basis of name
2838
- Use netrc file from home directory if not present
2939

40+
3041
v0.6.1
3142
------
3243

setup.cfg

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
[metadata]
2+
name = python-inspector
3+
license = Apache-2.0
4+
5+
# description must be on ONE line https://github.com/pypa/setuptools/issues/1390
6+
description = python-inspector is is a collection of utilities to collect PyPI package metadata and resolve packages dependencies.
7+
long_description = file:README.rst
8+
long_description_content_type = text/x-rst
9+
url = https://github.com/nexB/python-inspector
10+
11+
author = nexB. Inc. and others
12+
author_email = info@aboutcode.org
13+
14+
classifiers =
15+
Development Status :: 4 - Beta
16+
Intended Audience :: Developers
17+
Programming Language :: Python :: 3
18+
Programming Language :: Python :: 3 :: Only
19+
Topic :: Software Development
20+
Topic :: Utilities
21+
22+
keywords =
23+
open source
24+
scan
25+
package
26+
dependency
27+
pypi
28+
python
29+
SBOM
30+
sca
31+
dependencies
32+
dependency resolution
33+
resolver
34+
resolvelib
35+
pip
36+
requirements
37+
38+
license_files =
39+
apache-2.0.LICENSE
40+
NOTICE
41+
AUTHORS.rst
42+
CHANGELOG.rst
43+
CODE_OF_CONDUCT.rst
44+
45+
[options]
46+
package_dir =
47+
=src
48+
packages = find:
49+
include_package_data = true
50+
zip_safe = false
51+
52+
setup_requires = setuptools_scm[toml] >= 4
53+
54+
python_requires = >=3.6.*
55+
56+
install_requires =
57+
attrs >= 18.1, !=20.1.0
58+
click > 7.0
59+
colorama >= 0.3.9
60+
commoncode >= 30.0.0
61+
dparse2 >= 0.6.1
62+
importlib_metadata >= 4.12.0
63+
packageurl_python >= 0.9.0
64+
pkginfo2 >= 30.0.0
65+
pip-requirements-parser >= 31.2.0
66+
requests >= 2.18.0
67+
resolvelib >= 0.8.1
68+
saneyaml >= 0.5.2
69+
tinynetrc >= 1.3.1
70+
toml >= 0.10.0
71+
mock >= 3.0.5
72+
73+
[options.packages.find]
74+
where = src
75+
76+
[options.entry_points]
77+
console_scripts =
78+
python-inspector = python_inspector.resolve_cli:resolve_dependencies
79+
80+
[options.extras_require]
81+
testing =
82+
pytest >= 6, != 7.0.0
83+
pytest-xdist >= 2
84+
aboutcode-toolkit >= 7.0.2
85+
twine
86+
black
87+
isort
88+
pycodestyle
89+
90+
docs =
91+
Sphinx >= 3.3.1
92+
sphinx-rtd-theme >= 0.5.0
93+
doc8 >= 0.8.1

src/python_inspector/package_data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ def get_pypi_data_from_purl(
9292
from python_inspector.resolution import get_response
9393

9494
response = get_response(api_url)
95+
if not response:
96+
return []
9597
info = response.get("info") or {}
9698
homepage_url = info.get("home_page")
9799
license = info.get("license")

src/python_inspector/resolve_cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@ def print_version(ctx, param, value):
158158
"--index-url are ignored when this option is active.",
159159
)
160160
@click.option(
161-
"--insecure",
161+
"--analyze-setup-py-insecurely",
162162
is_flag=True,
163-
help="Resolve insecurely",
163+
help="Enable collection of requirements in setup.py that compute these"
164+
" dynamically. This is an insecure operation as it can run arbitrary code.",
164165
)
165166
@click.option(
166167
"--verbose",

0 commit comments

Comments
 (0)