Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
ea5044d
Create script to update repo skeleton #80
JonoYang Jul 17, 2023
a929052
Drop deprecated macos-12 runner
AyanSinhaMahapatra Jan 17, 2025
acb36f5
Merge pull request #92 from aboutcode-org/drop-macos-12
AyanSinhaMahapatra Jan 17, 2025
4af4fce
Update CI/Actions runners
AyanSinhaMahapatra Feb 14, 2025
df02630
Merge pull request #93 from aboutcode-org/update-ci-runners
AyanSinhaMahapatra Feb 14, 2025
320ec21
Replace black and isort with ruff
JonoYang Mar 27, 2025
d4e29c3
Use org standard 100 line length
pombredanne Mar 28, 2025
6c028f7
Lint all common code directories
pombredanne Mar 29, 2025
233f3ed
Remove unused targets
pombredanne Mar 29, 2025
55545bf
Improve import sorting
pombredanne Mar 29, 2025
0b63e50
Apply small code updates
pombredanne Mar 29, 2025
092f545
Format code
pombredanne Mar 29, 2025
d05665a
Apply cosmetic refactorings
pombredanne Mar 29, 2025
63bcbf5
Reformat test code
pombredanne Mar 29, 2025
9d1393a
Format code
pombredanne Mar 29, 2025
f10b783
Refine ruff configuration
pombredanne Mar 29, 2025
1d6c8f3
Format doc
pombredanne Mar 29, 2025
0213c1e
Run doc8 on all rst files
pombredanne Mar 29, 2025
c112f2a
Enable doc style checks
pombredanne Mar 29, 2025
944b6c5
Add support for new OS versions
pombredanne Mar 28, 2025
a2ced96
Merge pull request #94 from aboutcode-org/new-osses
pombredanne Mar 30, 2025
136af39
Update scripts aboutcode references
pombredanne Mar 30, 2025
da8eff0
Do not format more test data
pombredanne Mar 30, 2025
4f9e936
Do not treat rst as Python
pombredanne Mar 30, 2025
a2809fb
Combine testing and docs extra for simplicity
pombredanne Mar 30, 2025
43b96c2
Refine checking of docs with doc8
pombredanne Mar 30, 2025
b7194c8
Refine doc handling
pombredanne Mar 30, 2025
a5bcdbd
Add twine check to release publication
pombredanne Mar 30, 2025
a6c25fb
Refine doc contribution docs
pombredanne Mar 30, 2025
dc123f1
Merge pull request #95 from aboutcode-org/80-update-skeleton-script
JonoYang Mar 31, 2025
68daae1
Replace black and isort with ruff
JonoYang Mar 27, 2025
6a8c9ae
Use org standard 100 line length
pombredanne Mar 28, 2025
2fd31d5
Lint all common code directories
pombredanne Mar 29, 2025
eb5fc82
Remove unused targets
pombredanne Mar 29, 2025
529d516
Improve import sorting
pombredanne Mar 29, 2025
aae1a28
Apply small code updates
pombredanne Mar 29, 2025
037f9fc
Format code
pombredanne Mar 29, 2025
1189dda
Apply cosmetic refactorings
pombredanne Mar 29, 2025
84257fb
Reformat test code
pombredanne Mar 29, 2025
00684f7
Format code
pombredanne Mar 29, 2025
7c4278d
Refine ruff configuration
pombredanne Mar 29, 2025
47cb840
Format doc
pombredanne Mar 29, 2025
7b29b59
Run doc8 on all rst files
pombredanne Mar 29, 2025
86c7ca4
Enable doc style checks
pombredanne Mar 29, 2025
71583c5
Do not format more test data
pombredanne Mar 30, 2025
0f1a403
Do not treat rst as Python
pombredanne Mar 30, 2025
6bea657
Combine testing and docs extra for simplicity
pombredanne Mar 30, 2025
c615589
Refine checking of docs with doc8
pombredanne Mar 30, 2025
04e0a89
Refine doc handling
pombredanne Mar 30, 2025
8897cc6
Add twine check to release publication
pombredanne Mar 30, 2025
3d42985
Refine doc contribution docs
pombredanne Mar 30, 2025
f428366
Update codestyle command
JonoYang Mar 31, 2025
f0d0e21
Update README.rst
JonoYang Mar 31, 2025
f3a8aa6
Update BUILDDIR envvar in docs/Makefile
JonoYang Mar 31, 2025
5b0f4d6
Fix doc line length
pombredanne Apr 1, 2025
7b6f41f
Merge branch 'add-code-style-checks' of https://github.com/nexB/skeleton
pombredanne Apr 1, 2025
e776fef
Format code
pombredanne Apr 1, 2025
2a43f4c
Correct supported runner on Azure
pombredanne Apr 1, 2025
4a15550
Add code checks to CI
pombredanne Apr 1, 2025
b2d7512
Revert support for Python 3.13
pombredanne Apr 1, 2025
2e3464b
Ignore local .env file
pombredanne Apr 2, 2025
d4af79f
Add correct extras for documentation
pombredanne Apr 2, 2025
49bfd37
Improve MANIFEST
pombredanne Apr 2, 2025
5bc987a
Improve cleaning on POSIX
pombredanne Apr 2, 2025
887779a
Rename dev extra to "dev"
pombredanne Apr 2, 2025
209231f
Add more excludes from tests
pombredanne Apr 2, 2025
47bce2d
Do not lint django migrations
pombredanne Apr 2, 2025
5025cfb
Add README.rst to list of "license files"
pombredanne Apr 2, 2025
548a72e
Use Python 3.9 as lowest suupported version
pombredanne Apr 2, 2025
3d256b4
Drop pycodestyle
pombredanne Apr 2, 2025
6450529
Bump pytest minimal version
pombredanne Apr 2, 2025
4f9751c
Merge pull request #96 from aboutcode-org/add-code-style-checks
pombredanne Apr 4, 2025
af87cfa
Update CI runners and scripts
AyanSinhaMahapatra Jun 24, 2025
c1002c2
Merge pull request #97 from aboutcode-org/update-ci-and-runners
AyanSinhaMahapatra Jun 24, 2025
a98a47b
Merge remote-tracking branch 'skeleton/main' into release-prep-v30.4.2
AyanSinhaMahapatra Jun 24, 2025
d7de327
Add licenses from scancode licenseDB and bump version
AyanSinhaMahapatra Jun 24, 2025
ccdfcd2
Fix test failures
AyanSinhaMahapatra Jun 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,29 @@ on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

strategy:
max-parallel: 4
matrix:
python-version: [3.9]
python-version: [3.13]

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: pip install -e .[docs]
run: ./configure --dev

- name: Check Sphinx Documentation build minimally
working-directory: ./docs
run: python3 -m sphinx -E -W source build
- name: Check documentation and HTML for errors and dead links
run: make docs-check

- name: Check for documentation style errors
working-directory: ./docs
run: ./scripts/doc8_style_check.sh
- name: Check documentation for style errors
run: make doc8


21 changes: 12 additions & 9 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,21 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.12

- name: Install pypa/build
run: python -m pip install build --user
- name: Install pypa/build and twine
run: python -m pip install --user --upgrade build twine pkginfo

- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/
run: python -m build --sdist --outdir dist/

- name: Validate wheel and sdis for Pypi
run: python -m twine check dist/*

- name: Upload built archives
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pypi_archives
path: dist/*
Expand All @@ -54,13 +57,13 @@ jobs:

steps:
- name: Download built archives
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: pypi_archives
path: dist

- name: Create GH release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
draft: true
files: dist/*
Expand All @@ -74,7 +77,7 @@ jobs:

steps:
- name: Download built archives
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: pypi_archives
path: dist
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ tcl
# Ignore Jupyter Notebook related temp files
.ipynb_checkpoints/
/.tox/
/.ruff_cache/
.env
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ python:
- method: pip
path: .
extra_requirements:
- docs
- dev
2 changes: 2 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ The following organizations or individuals have contributed to this code:
- Jono Yang @JonoYang
- Max Mehl @mxmehl
- nexB Inc. @nexB
- Pablo Castellazzi @pcastellazzi
- Peter Kolbus @pkolbus
- Philippe Ombredanne @pombredanne
- Sebastian Schuberth @sschuberth
- Steven Esser @majurg
- Thomas Druez @tdruez
- Uwe L. Korn @xhochy
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
=========

v30.4.2 - 2025-06-25
--------------------

This is a minor release without API changes:

- Use latest skeleton
- Update license list to latest ScanCode


v30.4.1 - 2025-01-10
--------------------

Expand Down
14 changes: 12 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
graft src
graft docs
graft etc

include *.LICENSE
include NOTICE
include *.ABOUT
include *.toml
include *.yml
include *.rst
include *.png
include setup.*
include configure*
include requirements*
include .git*
include .dockerignore
include .gitignore
include .readthedocs.yml
include manage.py
include Dockerfile*
include Makefile
include MANIFEST.in

global-exclude *.py[co] __pycache__ *.*~
include .VERSION

global-exclude *.py[co] __pycache__ *.*~
42 changes: 23 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@ PYTHON_EXE?=python3
VENV=venv
ACTIVATE?=. ${VENV}/bin/activate;

dev:
@echo "-> Configure the development envt."
./configure --dev

isort:
@echo "-> Apply isort changes to ensure proper imports ordering"
${VENV}/bin/isort --sl -l 100 src tests setup.py
conf:
@echo "-> Install dependencies"
./configure

black:
@echo "-> Apply black code formatter"
${VENV}/bin/black -l 100 src tests setup.py
dev:
@echo "-> Configure and install development dependencies"
./configure --dev

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

valid: isort black
valid:
@echo "-> Run Ruff format"
@${ACTIVATE} ruff format
@echo "-> Run Ruff linter"
@${ACTIVATE} ruff check --fix

check:
@echo "-> Run pycodestyle (PEP8) validation"
@${ACTIVATE} pycodestyle --max-line-length=100 --exclude=.eggs,venv,lib,thirdparty,docs,migrations,settings.py,.cache .
@echo "-> Run isort imports ordering validation"
@${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests .
@echo "-> Run black validation"
@${ACTIVATE} black --check --check -l 100 src tests setup.py
@echo "-> Run Ruff linter validation (pycodestyle, bandit, isort, and more)"
@${ACTIVATE} ruff check
@echo "-> Run Ruff format validation"
@${ACTIVATE} ruff format --check
@$(MAKE) doc8

clean:
@echo "-> Clean the Python env"
Expand All @@ -49,6 +49,10 @@ test:

docs:
rm -rf docs/_build/
@${ACTIVATE} sphinx-build docs/ docs/_build/
@${ACTIVATE} sphinx-build docs/source docs/_build/

docs-check:
@${ACTIVATE} sphinx-build -E -W -b html docs/source docs/_build/
@${ACTIVATE} sphinx-build -E -W -b linkcheck docs/source docs/_build/

.PHONY: conf dev check valid black isort clean test docs
.PHONY: conf dev check valid clean test docs docs-check
93 changes: 32 additions & 61 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ license expression engine in several projects and products such as:

- AboutCode-toolkit https://github.com/aboutcode-org/aboutcode-toolkit
- AlekSIS (School Information System) https://edugit.org/AlekSIS/official/AlekSIS-Core
- Barista https://github.com/Optum/barista
- Conda forge tools https://github.com/conda-forge/conda-smithy
- DejaCode https://dejacode.com
- DejaCode https://enterprise.dejacode.com
- DeltaCode https://github.com/nexB/deltacode
- FenixscanX https://github.com/SmartsYoung/FenixscanX
- FetchCode https://github.com/aboutcode-org/fetchcode
Expand All @@ -49,7 +48,7 @@ license expression engine in several projects and products such as:
- SecObserve https://github.com/MaibornWolff/SecObserve

See also for details:
- https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/
- https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions

``license-expression`` is also packaged for most Linux distributions. See below.

Expand All @@ -65,17 +64,6 @@ libraries in other languages (but not as powerful of course!):
- Ada https://github.com/Fabien-Chouteau/spdx_ada
- Java https://github.com/spdx/tools and https://github.com/aschet/spdx-license-expression-tools

Build and tests status
======================

+--------------------------+------------------------+----------------------------------+
|**Linux & macOS (Travis)**| **Windows (AppVeyor)** |**Linux, Windows & macOS (Azure)**|
+==========================+========================+==================================+
| | | |
| |travis-badge-icon| | |appveyor-badge-icon| | |azure-badge-icon| |
| | | |
+--------------------------+------------------------+----------------------------------+

Source code and download
========================

Expand Down Expand Up @@ -125,36 +113,36 @@ validate, compare, simplify and normalize license expressions.

Create an SPDX Licensing and parse expressions::

>>> from license_expression import get_spdx_licensing
>>> licensing = get_spdx_licensing()
>>> expression = ' GPL-2.0 or LGPL-2.1 and mit '
>>> parsed = licensing.parse(expression)
>>> print(parsed.pretty())
OR(
LicenseSymbol('GPL-2.0-only'),
AND(
LicenseSymbol('LGPL-2.1-only'),
LicenseSymbol('MIT')
)
)

>>> str(parsed)
'GPL-2.0-only OR (LGPL-2.1-only AND MIT)'

>>> licensing.parse('unknwon with foo', validate=True, strict=True)
license_expression.ExpressionParseError: A plain license symbol cannot be used
as an exception in a "WITH symbol" statement. for token: "foo" at position: 13

>>> licensing.parse('unknwon with foo', validate=True)
license_expression.ExpressionError: Unknown license key(s): unknwon, foo

>>> licensing.validate('foo and MIT and GPL-2.0+')
ExpressionInfo(
original_expression='foo and MIT and GPL-2.0+',
normalized_expression=None,
errors=['Unknown license key(s): foo'],
invalid_symbols=['foo']
)
>>> from license_expression import get_spdx_licensing
>>> licensing = get_spdx_licensing()
>>> expression = ' GPL-2.0 or LGPL-2.1 and mit '
>>> parsed = licensing.parse(expression)
>>> print(parsed.pretty())
OR(
LicenseSymbol('GPL-2.0-only'),
AND(
LicenseSymbol('LGPL-2.1-only'),
LicenseSymbol('MIT')
)
)

>>> str(parsed)
'GPL-2.0-only OR (LGPL-2.1-only AND MIT)'

>>> licensing.parse('unknwon with foo', validate=True, strict=True)
license_expression.ExpressionParseError: A plain license symbol cannot be used
as an exception in a "WITH symbol" statement. for token: "foo" at position: 13

>>> licensing.parse('unknwon with foo', validate=True)
license_expression.ExpressionError: Unknown license key(s): unknwon, foo

>>> licensing.validate('foo and MIT and GPL-2.0+')
ExpressionInfo(
original_expression='foo and MIT and GPL-2.0+',
normalized_expression=None,
errors=['Unknown license key(s): foo'],
invalid_symbols=['foo']
)


Create a simple Licensing and parse expressions::
Expand Down Expand Up @@ -243,20 +231,3 @@ Development
- On Windows run ``configure.bat --dev`` and then ``Scripts\bin\activate`` instead.

- To run the tests, run ``pytest -vvs``


.. |travis-badge-icon| image:: https://api.travis-ci.org/nexB/license-expression.png?branch=master
:target: https://travis-ci.org/nexB/license-expression
:alt: Travis tests status
:align: middle

.. |appveyor-badge-icon| image:: https://ci.appveyor.com/api/projects/status/github/nexB/license-expression?svg=true
:target: https://ci.appveyor.com/project/nexB/license-expression
:alt: Appveyor tests status
:align: middle

.. |azure-badge-icon| image:: https://dev.azure.com/nexB/license-expression/_apis/build/status/nexB.license-expression?branchName=master
:target: https://dev.azure.com/nexB/license-expression/_build/latest?definitionId=2&branchName=master
:alt: Azure pipelines tests status
:align: middle

12 changes: 10 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
################################################################################

jobs:
- template: etc/ci/azure-posix.yml
parameters:
job_name: run_code_checks
image_name: ubuntu-24.04
python_versions: ['3.13']
test_suites:
all: make check

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu22_cpython
Expand Down Expand Up @@ -39,8 +47,8 @@ jobs:

- template: etc/ci/azure-win.yml
parameters:
job_name: win2019_cpython
image_name: windows-2019
job_name: win2025_cpython
image_name: windows-2025
python_versions: ["3.9", "3.10", "3.11", "3.12", "3.13"]
test_suites:
all: venv\Scripts\pytest -n 2 -vvs
Expand Down
Loading