Skip to content

Commit ceb345e

Browse files
tdruezkeshav-space
andauthored
Add pyproject.toml for packaging aboutcode.pipeline module #1351 (#1359)
* Add pyproject.toml for packaging aboutcode.pipeline module #1351 Signed-off-by: tdruez <[email protected]> * Add GitHub action to publish aboutcode.pipeline Signed-off-by: Keshav Priyadarshi <[email protected]> * Enable GitHub release Signed-off-by: Keshav Priyadarshi <[email protected]> * Refine workflow and add documentation and changelog #1351 Signed-off-by: tdruez <[email protected]> --------- Signed-off-by: tdruez <[email protected]> Signed-off-by: Keshav Priyadarshi <[email protected]> Co-authored-by: Keshav Priyadarshi <[email protected]>
1 parent eeff642 commit ceb345e

File tree

6 files changed

+120
-1
lines changed

6 files changed

+120
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build aboutcode.pipeline Python distributions and publish on PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "aboutcode.pipeline/*"
8+
9+
jobs:
10+
build-and-publish:
11+
name: Build and publish library to PyPI
12+
runs-on: ubuntu-22.04
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: 3.12
21+
22+
- name: Install flot
23+
run: python -m pip install flot --user
24+
25+
- name: Build a binary wheel and a source tarball
26+
run: python -m flot --pyproject pipeline-pyproject.toml --sdist --wheel --output-dir dist/
27+
28+
- name: Publish to PyPI
29+
if: startsWith(github.ref, 'refs/tags')
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
password: ${{ secrets.PYPI_API_TOKEN }}
33+
34+
- name: Upload built archives
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: pypi_archives
38+
path: dist/*

aboutcode/pipeline/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## Release 0.1.0 (August 9, 2023)
4+
5+
* Initial release of the `aboutcode.pipeline` library. [Issue #1351](https://github.com/nexB/scancode.io/issues/1351)

aboutcode/pipeline/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Define and run pipelines.
55
### Install
66

77
```bash
8-
pip install aboutcode_pipeline
8+
pip install aboutcode.pipeline
99
```
1010

1111
### Define and execute a pipeline

aboutcode/pipeline/RELEASE.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Release instructions for `aboutcode.pipeline`
2+
3+
### Automated release workflow
4+
5+
- Create a new `aboutcode.pipeline-release-x.x.x` branch
6+
- Update the version in:
7+
- `pipeline-pyproject.toml`
8+
- `aboutcode/pipeline/__init__.py`
9+
- Commit and push this branch
10+
- Create a PR and merge once approved
11+
- Tag and push to trigger the `pypi-release-aboutcode-pipeline.yml` workflow that
12+
takes care of building the distribution archives and upload those to pypi::
13+
```
14+
VERSION=x.x.x # <- Set the new version here
15+
TAG=aboutcode.pipeline/$VERSION
16+
git tag -a $TAG -m ""
17+
git push origin $TAG
18+
```
19+
20+
### Manual build
21+
22+
```
23+
cd scancode.io
24+
source .venv/bin/activate
25+
pip install flot
26+
flot --pyproject pipeline-pyproject.toml --sdist --wheel --output-dir dist/
27+
```
28+
29+
The distribution archives will be available in the local `dist/` directory.

aboutcode/pipeline/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
module_logger = logging.getLogger(__name__)
3232

33+
__version__ = "0.1.0"
34+
3335

3436
class PipelineDefinition:
3537
"""

pipeline-pyproject.toml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[build-system]
2+
requires = ["flot"]
3+
build-backend = "flot.buildapi"
4+
5+
[project]
6+
name = "aboutcode.pipeline"
7+
version = "0.1.0"
8+
description = "AboutCode Pipeline library. Execute code in steps."
9+
license = { text = "Apache-2.0" }
10+
readme = "aboutcode/pipeline/README.md"
11+
requires-python = ">=3.9"
12+
authors = [ { name = "nexB. Inc. and others", email = "[email protected]" } ]
13+
keywords = [
14+
"open source",
15+
"pipeline",
16+
"scancode",
17+
]
18+
classifiers = [
19+
"Development Status :: 4 - Beta",
20+
"Intended Audience :: Developers",
21+
"Programming Language :: Python :: 3",
22+
"Programming Language :: Python :: 3 :: Only",
23+
"Programming Language :: Python :: 3.9",
24+
"Programming Language :: Python :: 3.10",
25+
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
27+
"Topic :: Software Development",
28+
"Topic :: Utilities",
29+
]
30+
31+
[project.urls]
32+
Homepage = "https://github.com/nexB/scancode.io"
33+
Documentation = "https://scancodeio.readthedocs.io/"
34+
Changelog = "https://github.com/nexB/scancode.io/tree/main/aboutcode/pipeline/CHANGELOG.md"
35+
Repository = "https://github.com/nexB/scancode.io/tree/main/aboutcode/pipeline"
36+
Issues = "https://github.com/nexB/scancode.io/issues"
37+
38+
[tool.flot]
39+
includes = [
40+
"aboutcode/pipeline/*",
41+
]
42+
metadata_files = [
43+
"LICENSE",
44+
"NOTICE",
45+
]

0 commit comments

Comments
 (0)