Skip to content

Commit b414680

Browse files
authored
Replace the setup.py/setup.cfg by pyproject.toml #1608 (#1709)
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent 90f396b commit b414680

File tree

9 files changed

+163
-209
lines changed

9 files changed

+163
-209
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Changelog
44
v35.1.0 (unreleased)
55
--------------------
66

7+
- Replace the ``setup.py``/``setup.cfg`` by ``pyproject.toml`` file.
8+
https://github.com/aboutcode-org/scancode.io/issues/1608
9+
710
- Add a ``--fail-on-vulnerabilities`` option in ``check-compliance`` management command.
811
When this option is enabled, the command will exit with a non-zero status if known
912
vulnerabilities are detected in discovered packages and dependencies.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ RUN mkdir -p /var/$APP_NAME/static/ \
8787
&& mkdir -p /var/$APP_NAME/workspace/
8888

8989
# Install the dependencies before the codebase COPY for proper Docker layer caching
90-
COPY --chown=$APP_USER:$APP_USER setup.cfg setup.py $APP_DIR/
90+
COPY --chown=$APP_USER:$APP_USER pyproject.toml $APP_DIR/
9191
RUN pip install --no-cache-dir .
9292

9393
# Copy the codebase and set the proper permissions for the APP_USER

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,6 @@ docs:
143143
rm -rf docs/_build/
144144
@${ACTIVATE} sphinx-build docs/ docs/_build/
145145

146-
bump:
147-
@echo "-> Bump the version"
148-
@${ACTIVATE} bumpver update --no-fetch --patch
149-
150146
docker-images:
151147
@echo "-> Build Docker services"
152148
docker compose build
@@ -163,4 +159,4 @@ offline-package: docker-images
163159
@mkdir -p dist/
164160
@tar -cf dist/scancodeio-offline-package-`git describe --tags`.tar build/
165161

166-
.PHONY: virtualenv conf dev envfile install doc8 check valid check-deploy clean migrate upgrade postgresdb sqlitedb backupdb run run-docker-dev test fasttest docs bump docker-images offline-package
162+
.PHONY: virtualenv conf dev envfile install doc8 check valid check-deploy clean migrate upgrade postgresdb sqlitedb backupdb run run-docker-dev test fasttest docs docker-images offline-package

RELEASE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- Create a new `release-x.x.x` branch
66
- Update the version in:
7-
- `setup.cfg` (2 entries)
7+
- `pyproject.toml`
88
- `scancodeio/__init__.py`
99
- `CHANGELOG.rst` (set date)
1010
- Commit and push this branch
@@ -24,7 +24,7 @@
2424
```
2525
cd scancode.io
2626
source .venv/bin/activate
27-
pip install build
27+
python -m pip install build
2828
python -m build --sdist --wheel --outdir dist/ .
2929
```
3030

docs/introduction.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ The **Django framework** is leveraged for many aspects of ScanCode.io:
9191

9292
.. note::
9393
Multiple applications from the Django eco-system are also included,
94-
see the `setup.cfg <https://github.com/aboutcode-org/scancode.io/blob/main/setup.cfg>`_ file
95-
for an exhaustive list of dependencies.
94+
see the `pyproject.toml <https://github.com/aboutcode-org/scancode.io/blob/main/pyproject.toml>`_
95+
file for an exhaustive list of dependencies.
9696

9797
The second essential part of ScanCode.io is the **ScanCode Toolkit**, which is used
9898
for archives extraction and as the scanning engine.

docs/rest-api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ File content
533533
This displays the content of a ``project`` file resource provided using the
534534
``?path=<resource_path>`` argument.
535535

536-
``GET /api/projects/d4ed9405-5568-45ad-99f6-782a9b82d1d2/file_content/?path=setup.py``
536+
``GET /api/projects/d4ed9405-5568-45ad-99f6-782a9b82d1d2/file_content/?path=filename.ext``
537537

538538
.. code-block:: json
539539

pyproject.toml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,156 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "scancodeio"
7+
version = "35.0.0"
8+
description = "Automate software composition analysis pipelines"
9+
readme = "README.rst"
10+
requires-python = ">=3.10,<3.14"
11+
license = "Apache-2.0"
12+
license-files = ["LICENSE", "NOTICE", "scan.NOTICE"]
13+
authors = [
14+
{ name = "nexB Inc.", email = "info@aboutcode.org" }
15+
]
16+
keywords = [
17+
"open source", "scan", "license", "package", "dependency",
18+
"copyright", "filetype", "author", "extract", "licensing",
19+
"scancode", "scanpipe", "docker", "rootfs", "vm",
20+
"virtual machine", "pipeline", "code analysis", "container"
21+
]
22+
classifiers = [
23+
"Development Status :: 5 - Production/Stable",
24+
"Intended Audience :: Developers",
25+
"Intended Audience :: Information Technology",
26+
"Intended Audience :: Legal Industry",
27+
"Programming Language :: Python",
28+
"Programming Language :: Python :: 3 :: Only",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
32+
"Programming Language :: Python :: 3.13",
33+
"Topic :: Utilities"
34+
]
35+
dependencies = [
36+
"importlib-metadata==8.7.0",
37+
"setuptools==80.9.0",
38+
# Django related
39+
"Django==5.1.11",
40+
"django-environ==0.12.0",
41+
"django-crispy-forms==2.4",
42+
"crispy-bootstrap3==2024.1",
43+
"django-filter==25.1",
44+
"djangorestframework==3.16.0",
45+
"django-taggit==6.1.0",
46+
# Database
47+
"psycopg[binary]==3.2.9",
48+
# wait_for_database Django management command
49+
"django-probes==1.7.0",
50+
# Task queue
51+
"rq==2.4.0",
52+
"django-rq==3.0.1",
53+
"redis==6.2.0",
54+
# WSGI server
55+
"gunicorn==23.0.0",
56+
# Docker
57+
"container-inspector==33.0.0",
58+
# ScanCode-toolkit
59+
"scancode-toolkit[packages]==32.4.0",
60+
"extractcode[full]==31.0.0",
61+
"commoncode==32.3.0",
62+
"Beautifulsoup4[chardet]==4.13.4",
63+
"packageurl-python==0.17.1",
64+
# FetchCode
65+
"fetchcode-container==1.2.3.210512; sys_platform == 'linux'",
66+
# Inspectors
67+
"elf-inspector==0.0.3",
68+
"go-inspector==0.5.0",
69+
"rust-inspector==0.1.0",
70+
"binary-inspector==0.1.2",
71+
"python-inspector==0.14.0",
72+
"source-inspector==0.7.0; sys_platform != 'darwin' and platform_machine != 'arm64'",
73+
"aboutcode-toolkit==11.1.1",
74+
# Utilities
75+
"XlsxWriter==3.2.5",
76+
"openpyxl==3.1.5",
77+
"requests==2.32.4",
78+
"GitPython==3.1.44",
79+
# Profiling
80+
"pyinstrument==5.0.2",
81+
# CycloneDX
82+
"cyclonedx-python-lib==10.2.0",
83+
"jsonschema==4.24.0",
84+
# MatchCode-toolkit
85+
"matchcode-toolkit==7.2.2",
86+
# Univers
87+
"univers==31.0.0",
88+
# Markdown
89+
"markdown-it-py==3.0.0",
90+
"bleach==6.2.0",
91+
# Antivirus
92+
"clamd==1.0.2",
93+
# FederatedCode
94+
"aboutcode.hashid==0.2.0",
95+
# AboutCode pipeline
96+
"aboutcode.pipeline==0.2.1",
97+
"scipy==1.15.3"
98+
]
99+
100+
[project.optional-dependencies]
101+
dev = [
102+
# Validation
103+
"ruff==0.12.0",
104+
"doc8==2.0.0",
105+
# Debug
106+
"django-debug-toolbar==5.2.0",
107+
# Documentation
108+
"Sphinx==8.1.3",
109+
"sphinx-rtd-theme==3.0.2",
110+
"sphinx-rtd-dark-mode==1.3.0",
111+
"sphinxcontrib-django==2.5",
112+
]
113+
android_analysis = [
114+
"android_inspector==0.0.1"
115+
]
116+
117+
[project.urls]
118+
Homepage = "https://github.com/aboutcode-org/scancode.io"
119+
Documentation = "https://scancodeio.readthedocs.io/"
120+
Repository = "https://github.com/aboutcode-org/scancode.io.git"
121+
Issues = "https://github.com/aboutcode-org/scancode.io/issues"
122+
Changelog = "https://github.com/aboutcode-org/scancode.io/blob/main/CHANGELOG.rst"
123+
124+
[project.scripts]
125+
scanpipe = "scancodeio:command_line"
126+
run = "scancodeio:combined_run"
127+
128+
[project.entry-points."scancodeio_pipelines"]
129+
analyze_docker_image = "scanpipe.pipelines.analyze_docker:Docker"
130+
analyze_root_filesystem_or_vm_image = "scanpipe.pipelines.analyze_root_filesystem:RootFS"
131+
analyze_windows_docker_image = "scanpipe.pipelines.analyze_docker_windows:DockerWindows"
132+
collect_strings_gettext = "scanpipe.pipelines.collect_strings_gettext:CollectStringsGettext"
133+
collect_symbols_ctags = "scanpipe.pipelines.collect_symbols_ctags:CollectSymbolsCtags"
134+
collect_symbols_pygments = "scanpipe.pipelines.collect_symbols_pygments:CollectSymbolsPygments"
135+
collect_symbols_tree_sitter = "scanpipe.pipelines.collect_symbols_tree_sitter:CollectSymbolsTreeSitter"
136+
enrich_with_purldb = "scanpipe.pipelines.enrich_with_purldb:EnrichWithPurlDB"
137+
find_vulnerabilities = "scanpipe.pipelines.find_vulnerabilities:FindVulnerabilities"
138+
inspect_elf_binaries = "scanpipe.pipelines.inspect_elf_binaries:InspectELFBinaries"
139+
inspect_packages = "scanpipe.pipelines.inspect_packages:InspectPackages"
140+
load_inventory = "scanpipe.pipelines.load_inventory:LoadInventory"
141+
load_sbom = "scanpipe.pipelines.load_sbom:LoadSBOM"
142+
map_deploy_to_develop = "scanpipe.pipelines.deploy_to_develop:DeployToDevelop"
143+
match_to_matchcode = "scanpipe.pipelines.match_to_matchcode:MatchToMatchCode"
144+
populate_purldb = "scanpipe.pipelines.populate_purldb:PopulatePurlDB"
145+
publish_to_federatedcode = "scanpipe.pipelines.publish_to_federatedcode:PublishToFederatedCode"
146+
resolve_dependencies = "scanpipe.pipelines.resolve_dependencies:ResolveDependencies"
147+
scan_codebase = "scanpipe.pipelines.scan_codebase:ScanCodebase"
148+
scan_for_virus = "scanpipe.pipelines.scan_for_virus:ScanForVirus"
149+
scan_single_package = "scanpipe.pipelines.scan_single_package:ScanSinglePackage"
150+
151+
[tool.setuptools.packages.find]
152+
where = ["."]
153+
1154
[tool.ruff]
2155
line-length = 88
3156
extend-exclude = ["migrations", "var"]

0 commit comments

Comments
 (0)