Skip to content

Commit b1a331c

Browse files
Update pyproject.toml scripts to build with flot
Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org>
1 parent 12b1b5e commit b1a331c

3 files changed

Lines changed: 152 additions & 88 deletions

File tree

.github/workflows/commoncode-release.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,55 +16,56 @@ on:
1616
workflow_dispatch:
1717
push:
1818
tags:
19-
- "v*.*.*"
19+
- "commoncode-v*.*.*"
2020

2121
jobs:
2222
build-pypi-distribs:
23+
permissions:
24+
contents: read # to fetch code (actions/checkout)
25+
2326
name: Build and publish library to PyPI
2427
runs-on: ubuntu-24.04
2528

2629
steps:
27-
- name: Checkout repository
28-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
2931
with:
30-
persist-credentials: false # do not keep the token around
31-
32-
- name: Set up Python 3.12
33-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
32+
persist-credentials: false
33+
- name: Set up Python
34+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
3435
with:
35-
python-version: 3.12
36+
python-version: 3.14
3637

3738
- name: Install pypa/build and twine
38-
run: python -m pip install --user build twine
39+
run: python -m pip install --user --upgrade build twine pkginfo flot
3940

40-
- name: Build a binary wheel and a source tarball
41-
run: python -m build --sdist --wheel --outdir dist/
42-
43-
- name: Validate wheel and sdis for Pypi
44-
run: python -m twine check dist/*
41+
- name: Install requirements then build main and mini wheel
42+
run: etc/release/commoncode-create-pypi-wheel-and-sdist.sh
4543

4644
- name: Upload built archives
47-
uses: actions/upload-artifact@v4
45+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
4846
with:
4947
name: pypi_archives
5048
path: dist/*
5149

5250

5351
create-gh-release:
52+
permissions:
53+
contents: write
54+
5455
name: Create GH release
5556
needs:
5657
- build-pypi-distribs
5758
runs-on: ubuntu-24.04
5859

5960
steps:
6061
- name: Download built archives
61-
uses: actions/download-artifact@v4
62+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
6263
with:
6364
name: pypi_archives
6465
path: dist
6566

6667
- name: Create GH release
67-
uses: softprops/action-gh-release@v2
68+
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
6869
with:
6970
draft: true
7071
files: dist/*
@@ -81,11 +82,11 @@ jobs:
8182

8283
steps:
8384
- name: Download built archives
84-
uses: actions/download-artifact@v4
85+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
8586
with:
8687
name: pypi_archives
8788
path: dist
8889

8990
- name: Publish to PyPI
9091
if: startsWith(github.ref, 'refs/tags')
91-
uses: pypa/gh-action-pypi-publish@release/v1
92+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (c) nexB Inc. and others. All rights reserved.
4+
# ScanCode is a trademark of nexB Inc.
5+
# SPDX-License-Identifier: Apache-2.0
6+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
7+
# See https://github.com/nexB/scancode-toolkit for support or download.
8+
# See https://aboutcode.org for more information about nexB OSS projects.
9+
#
10+
11+
################################################################################
12+
# ScanCode release build script for PyPI wheels.
13+
# Build a wheel for the current Python version
14+
################################################################################
15+
16+
set -e
17+
# Un-comment to trace execution
18+
#set -x
19+
20+
./configure --dev
21+
22+
# build license data packages
23+
venv/bin/flot --pyproject pyproject-commoncode.toml --wheel --sdist
24+
25+
venv/bin/twine check dist/*
26+
27+
set +e
28+
set +x

pyproject-commoncode.toml

Lines changed: 104 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,106 @@
1-
[metadata]
2-
name = commoncode
3-
author = nexB. Inc. and others
4-
author_email = info@aboutcode.org
5-
license = Apache-2.0
1+
[build-system]
2+
requires = [ "flot>=0.7.0" ]
3+
build-backend = "flot.buildapi"
4+
5+
[project]
6+
name = "commoncode"
7+
version = "32.4.2"
8+
authors = [
9+
{ name = "nexB. Inc. and others", email = "info@aboutcode.org" },
10+
]
11+
license = "Apache-2.0"
612

713
# description must be on ONE line https://github.com/pypa/setuptools/issues/1390
8-
description = Set of common utilities, originally split from ScanCode
9-
long_description = file:README.rst
10-
long_description_content_type = text/x-rst
11-
url = https://github.com/aboutcode-org/commoncode
12-
classifiers =
13-
Development Status :: 5 - Production/Stable
14-
Intended Audience :: Developers
15-
Programming Language :: Python :: 3
16-
Programming Language :: Python :: 3 :: Only
17-
Topic :: Software Development
18-
Topic :: Utilities
19-
20-
keywords =
21-
utilities
22-
scancode-toolkit
23-
24-
license_files =
25-
apache-2.0.LICENSE
26-
NOTICE
27-
AUTHORS.rst
28-
CHANGELOG.rst
29-
CODE_OF_CONDUCT.rst
30-
README.rst
31-
commoncode.ABOUT
32-
33-
[options]
34-
python_requires = >=3.10
35-
package_dir =
36-
=src
37-
packages = find:
38-
include_package_data = true
39-
zip_safe = false
40-
41-
setup_requires = setuptools_scm[toml] >= 4
42-
43-
install_requires =
44-
attrs >= 18.1,!=20.1.0;python_version<'3.11'
45-
attrs >= 22.1.0;python_version>='3.11'
46-
Beautifulsoup4[chardet] >= 4.13.0
47-
click >= 8.3.0
48-
requests[use_chardet_on_py3] >= 2.7.0
49-
saneyaml >= 0.5.2
50-
text_unidecode >= 1.0
51-
52-
53-
[options.packages.find]
54-
where = src
55-
56-
57-
[options.extras_require]
58-
dev =
59-
pytest >= 7.0.1
60-
pytest-xdist >= 2
61-
aboutcode-toolkit >= 11.1.1
62-
pycodestyle >= 2.8.0
63-
twine
64-
ruff
65-
Sphinx>=5.0.2
66-
sphinx-rtd-theme>=1.0.0
67-
sphinx-reredirects >= 0.1.2
68-
doc8>=0.11.2
69-
sphinx-autobuild
70-
sphinx-rtd-dark-mode>=1.3.0
71-
sphinx-copybutton
14+
description = "Set of common utilities, originally split from ScanCode"
15+
long_description_content_type = "text/x-rst"
16+
readme = "src/commoncode/README.rst"
17+
18+
classifiers = [
19+
"Development Status :: 5 - Production/Stable",
20+
"Intended Audience :: Developers",
21+
"Programming Language :: Python :: 3",
22+
"Programming Language :: Python :: 3 :: Only",
23+
"Topic :: Software Development",
24+
"Topic :: Utilities",
25+
]
26+
27+
keywords = [
28+
"utilities",
29+
"scancode-toolkit"
30+
]
31+
32+
metadata_files = [
33+
"apache-2.0.LICENSE",
34+
"NOTICE",
35+
"AUTHORS.rst",
36+
"CHANGELOG.rst",
37+
"CODE_OF_CONDUCT.rst",
38+
"README.rst",
39+
"commoncode.ABOUT"
40+
]
41+
42+
requires-python = ">=3.10"
43+
44+
[project.urls]
45+
Homepage = "https://github.com/nexB/scancode-toolkit"
46+
47+
dependencies = [
48+
"attrs >= 18.1,!=20.1.0;python_version<'3.11'",
49+
"attrs >= 22.1.0;python_version>='3.11'",
50+
"Beautifulsoup4[chardet] >= 4.13.0",
51+
"click >= 8.3.0",
52+
"requests[use_chardet_on_py3] >= 2.7.0",
53+
"saneyaml >= 0.5.2",
54+
"text_unidecode >= 1.0"
55+
]
56+
57+
58+
[project.optional-dependencies]
59+
dev = [
60+
"pytest >= 7.0.1",
61+
"pytest-xdist >= 2",
62+
"aboutcode-toolkit >= 11.1.1",
63+
"pycodestyle >= 2.8.0",
64+
"twine",
65+
"ruff",
66+
"Sphinx>=5.0.2",
67+
"sphinx-rtd-theme>=1.0.0",
68+
"sphinx-reredirects >= 0.1.2",
69+
"doc8>=0.11.2",
70+
"sphinx-autobuild",
71+
"sphinx-rtd-dark-mode>=1.3.0",
72+
"sphinx-copybutton"
73+
]
74+
75+
[tool.flot]
76+
wheel_path_prefixes_to_strip = [ "src" ]
77+
78+
includes = [
79+
"src/commoncode/*",
80+
]
81+
82+
excludes = [
83+
"docs/build/**/*",
84+
85+
# Python compiled files
86+
"**/*.py[cod]",
87+
"**/*.egg-info",
88+
# Various junk and temp files
89+
"**/.DS_Store",
90+
"**/*~",
91+
"**/.*.sw[po]",
92+
"**/.ve",
93+
"**/*.bak",
94+
"**/.ipynb_checkpoints",
95+
]
96+
97+
metadata_files = [
98+
"*.LICENSE",
99+
"NOTICE",
100+
"AUTHORS.rst",
101+
"CHANGELOG.rst",
102+
"CODE_OF_CONDUCT.rst",
103+
]
104+
105+
editable_paths = [ "src/commoncode/", "tests/commoncode/" ]
106+

0 commit comments

Comments
 (0)