Skip to content

Commit cd5b3f1

Browse files
committed
Merge latest skeleton
Signed-off-by: Philippe Ombredanne <[email protected]>
2 parents 8ccbef3 + 6450529 commit cd5b3f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+6227
-41
lines changed

.github/workflows/docs-ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI Documentation
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-24.04
8+
9+
strategy:
10+
max-parallel: 4
11+
matrix:
12+
python-version: [3.12]
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Install Dependencies
24+
run: ./configure --dev
25+
26+
- name: Check documentation and HTML for errors and dead links
27+
run: make docs-check
28+
29+
- name: Check documentation for style errors
30+
run: make doc8
31+
32+

.github/workflows/pypi-release.yml

Lines changed: 56 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
name: Build Python distributions and publish on PyPI
1+
name: Create library release archives, create a GH release and publish PyPI wheel and sdist on tag in main branch
2+
3+
4+
# This is executed automatically on a tag in the main branch
5+
6+
# Summary of the steps:
7+
# - build wheels and sdist
8+
# - upload wheels and sdist to PyPI
9+
# - create gh-release and upload wheels and dists there
10+
# TODO: smoke test wheels and sdist
11+
# TODO: add changelog to release text body
12+
13+
# WARNING: this is designed only for packages building as pure Python wheels
214

315
on:
416
workflow_dispatch:
@@ -7,39 +19,68 @@ on:
719
- "v*.*.*"
820

921
jobs:
10-
build-and-publish:
22+
build-pypi-distribs:
1123
name: Build and publish library to PyPI
12-
runs-on: ubuntu-22.04
24+
runs-on: ubuntu-24.04
1325

1426
steps:
1527
- uses: actions/checkout@v4
16-
1728
- name: Set up Python
1829
uses: actions/setup-python@v5
1930
with:
2031
python-version: 3.12
2132

22-
- name: Install pypa/build
23-
run: python -m pip install build --user
33+
- name: Install pypa/build and twine
34+
run: python -m pip install --user build twine
2435

2536
- name: Build a binary wheel and a source tarball
26-
run: python -m build --sdist --wheel --outdir dist/ .
37+
run: python -m build --sdist --wheel --outdir dist/
2738

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 }}
39+
- name: Validate wheel and sdis for Pypi
40+
run: python -m twine check dist/*
3341

3442
- name: Upload built archives
3543
uses: actions/upload-artifact@v4
3644
with:
3745
name: pypi_archives
3846
path: dist/*
3947

40-
- name: Create a GitHub release
48+
49+
create-gh-release:
50+
name: Create GH release
51+
needs:
52+
- build-pypi-distribs
53+
runs-on: ubuntu-24.04
54+
55+
steps:
56+
- name: Download built archives
57+
uses: actions/download-artifact@v4
58+
with:
59+
name: pypi_archives
60+
path: dist
61+
62+
- name: Create GH release
4163
uses: softprops/action-gh-release@v2
4264
with:
43-
generate_release_notes: true
44-
draft: false
65+
draft: true
4566
files: dist/*
67+
68+
69+
create-pypi-release:
70+
name: Create PyPI release
71+
needs:
72+
- create-gh-release
73+
runs-on: ubuntu-24.04
74+
75+
steps:
76+
- name: Download built archives
77+
uses: actions/download-artifact@v4
78+
with:
79+
name: pypi_archives
80+
path: dist
81+
82+
- name: Publish to PyPI
83+
if: startsWith(github.ref, 'refs/tags')
84+
uses: pypa/gh-action-pypi-publish@release/v1
85+
with:
86+
password: ${{ secrets.PYPI_API_TOKEN }}

.readthedocs.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build in latest ubuntu/python
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.11"
13+
14+
# Build PDF & ePub
15+
formats:
16+
- epub
17+
- pdf
18+
19+
# Where the Sphinx conf.py file is located
20+
sphinx:
21+
configuration: docs/source/conf.py
22+
23+
# Setting the python version and doc build requirements
24+
python:
25+
install:
26+
- method: pip
27+
path: .
28+
extra_requirements:
29+
- dev

AUTHORS.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The following organizations or individuals have contributed to this repo:
2+
3+
-

CODE_OF_CONDUCT.rst

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
Contributor Covenant Code of Conduct
2+
====================================
3+
4+
Our Pledge
5+
----------
6+
7+
In the interest of fostering an open and welcoming environment, we as
8+
contributors and maintainers pledge to making participation in our
9+
project and our community a harassment-free experience for everyone,
10+
regardless of age, body size, disability, ethnicity, gender identity and
11+
expression, level of experience, education, socio-economic status,
12+
nationality, personal appearance, race, religion, or sexual identity and
13+
orientation.
14+
15+
Our Standards
16+
-------------
17+
18+
Examples of behavior that contributes to creating a positive environment
19+
include:
20+
21+
- Using welcoming and inclusive language
22+
- Being respectful of differing viewpoints and experiences
23+
- Gracefully accepting constructive criticism
24+
- Focusing on what is best for the community
25+
- Showing empathy towards other community members
26+
27+
Examples of unacceptable behavior by participants include:
28+
29+
- The use of sexualized language or imagery and unwelcome sexual
30+
attention or advances
31+
- Trolling, insulting/derogatory comments, and personal or political
32+
attacks
33+
- Public or private harassment
34+
- Publishing others’ private information, such as a physical or
35+
electronic address, without explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
Our Responsibilities
40+
--------------------
41+
42+
Project maintainers are responsible for clarifying the standards of
43+
acceptable behavior and are expected to take appropriate and fair
44+
corrective action in response to any instances of unacceptable behavior.
45+
46+
Project maintainers have the right and responsibility to remove, edit,
47+
or reject comments, commits, code, wiki edits, issues, and other
48+
contributions that are not aligned to this Code of Conduct, or to ban
49+
temporarily or permanently any contributor for other behaviors that they
50+
deem inappropriate, threatening, offensive, or harmful.
51+
52+
Scope
53+
-----
54+
55+
This Code of Conduct applies both within project spaces and in public
56+
spaces when an individual is representing the project or its community.
57+
Examples of representing a project or community include using an
58+
official project e-mail address, posting via an official social media
59+
account, or acting as an appointed representative at an online or
60+
offline event. Representation of a project may be further defined and
61+
clarified by project maintainers.
62+
63+
Enforcement
64+
-----------
65+
66+
Instances of abusive, harassing, or otherwise unacceptable behavior may
67+
be reported by contacting the project team at [email protected]
68+
or on the Gitter chat channel at https://gitter.im/aboutcode-org/discuss .
69+
All complaints will be reviewed and investigated and will result in a
70+
response that is deemed necessary and appropriate to the circumstances.
71+
The project team is obligated to maintain confidentiality with regard to
72+
the reporter of an incident. Further details of specific enforcement
73+
policies may be posted separately.
74+
75+
Project maintainers who do not follow or enforce the Code of Conduct in
76+
good faith may face temporary or permanent repercussions as determined
77+
by other members of the project’s leadership.
78+
79+
Attribution
80+
-----------
81+
82+
This Code of Conduct is adapted from the `Contributor Covenant`_ ,
83+
version 1.4, available at
84+
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
85+
86+
.. _Contributor Covenant: https://www.contributor-covenant.org

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ envfile:
6666

6767
doc8:
6868
@echo "-> Run doc8 validation"
69-
@${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/
69+
@${ACTIVATE} doc8 --quiet docs/ *.rst
7070

7171
valid:
7272
@echo "-> Run Ruff format"
@@ -147,6 +147,10 @@ docs:
147147
rm -rf docs/_build/
148148
@${ACTIVATE} sphinx-build docs/ docs/_build/
149149

150+
docs-check:
151+
@${ACTIVATE} sphinx-build -E -W -b html docs/ docs/_build/
152+
@${ACTIVATE} sphinx-build -E -W -b linkcheck docs/ docs/_build/
153+
150154
bump:
151155
@echo "-> Bump the version"
152156
@${ACTIVATE} bumpver update --no-fetch --patch
@@ -167,4 +171,4 @@ offline-package: docker-images
167171
@mkdir -p dist/
168172
@tar -cf dist/scancodeio-offline-package-`git describe --tags`.tar build/
169173

170-
.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
174+
.PHONY: virtualenv conf dev envfile install doc8 check valid check-deploy clean migrate upgrade postgresdb sqlitedb backupdb run run-docker-dev test fasttest docs docs-check bump docker-images offline-package

0 commit comments

Comments
 (0)