Skip to content

Commit ccdfcd2

Browse files
Fix test failures
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent d7de327 commit ccdfcd2

File tree

8 files changed

+1650
-1677
lines changed

8 files changed

+1650
-1677
lines changed

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ check:
3838
@echo "-> Run Ruff format validation"
3939
@${ACTIVATE} ruff format --check
4040
@$(MAKE) doc8
41-
@echo "-> Run ABOUT files validation"
42-
@${ACTIVATE} about check etc/
4341

4442
clean:
4543
@echo "-> Clean the Python env"

README.rst

Lines changed: 32 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ license expression engine in several projects and products such as:
3434

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

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

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

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

68-
Build and tests status
69-
======================
70-
71-
+--------------------------+------------------------+----------------------------------+
72-
|**Linux & macOS (Travis)**| **Windows (AppVeyor)** |**Linux, Windows & macOS (Azure)**|
73-
+==========================+========================+==================================+
74-
| | | |
75-
| |travis-badge-icon| | |appveyor-badge-icon| | |azure-badge-icon| |
76-
| | | |
77-
+--------------------------+------------------------+----------------------------------+
78-
7967
Source code and download
8068
========================
8169

@@ -125,36 +113,36 @@ validate, compare, simplify and normalize license expressions.
125113

126114
Create an SPDX Licensing and parse expressions::
127115

128-
>>> from license_expression import get_spdx_licensing
129-
>>> licensing = get_spdx_licensing()
130-
>>> expression = ' GPL-2.0 or LGPL-2.1 and mit '
131-
>>> parsed = licensing.parse(expression)
132-
>>> print(parsed.pretty())
133-
OR(
134-
LicenseSymbol('GPL-2.0-only'),
135-
AND(
136-
LicenseSymbol('LGPL-2.1-only'),
137-
LicenseSymbol('MIT')
138-
)
139-
)
140-
141-
>>> str(parsed)
142-
'GPL-2.0-only OR (LGPL-2.1-only AND MIT)'
143-
144-
>>> licensing.parse('unknwon with foo', validate=True, strict=True)
145-
license_expression.ExpressionParseError: A plain license symbol cannot be used
146-
as an exception in a "WITH symbol" statement. for token: "foo" at position: 13
147-
148-
>>> licensing.parse('unknwon with foo', validate=True)
149-
license_expression.ExpressionError: Unknown license key(s): unknwon, foo
150-
151-
>>> licensing.validate('foo and MIT and GPL-2.0+')
152-
ExpressionInfo(
153-
original_expression='foo and MIT and GPL-2.0+',
154-
normalized_expression=None,
155-
errors=['Unknown license key(s): foo'],
156-
invalid_symbols=['foo']
157-
)
116+
>>> from license_expression import get_spdx_licensing
117+
>>> licensing = get_spdx_licensing()
118+
>>> expression = ' GPL-2.0 or LGPL-2.1 and mit '
119+
>>> parsed = licensing.parse(expression)
120+
>>> print(parsed.pretty())
121+
OR(
122+
LicenseSymbol('GPL-2.0-only'),
123+
AND(
124+
LicenseSymbol('LGPL-2.1-only'),
125+
LicenseSymbol('MIT')
126+
)
127+
)
128+
129+
>>> str(parsed)
130+
'GPL-2.0-only OR (LGPL-2.1-only AND MIT)'
131+
132+
>>> licensing.parse('unknwon with foo', validate=True, strict=True)
133+
license_expression.ExpressionParseError: A plain license symbol cannot be used
134+
as an exception in a "WITH symbol" statement. for token: "foo" at position: 13
135+
136+
>>> licensing.parse('unknwon with foo', validate=True)
137+
license_expression.ExpressionError: Unknown license key(s): unknwon, foo
138+
139+
>>> licensing.validate('foo and MIT and GPL-2.0+')
140+
ExpressionInfo(
141+
original_expression='foo and MIT and GPL-2.0+',
142+
normalized_expression=None,
143+
errors=['Unknown license key(s): foo'],
144+
invalid_symbols=['foo']
145+
)
158146

159147

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

245233
- To run the tests, run ``pytest -vvs``
246-
247-
248-
.. |travis-badge-icon| image:: https://api.travis-ci.org/nexB/license-expression.png?branch=master
249-
:target: https://travis-ci.org/nexB/license-expression
250-
:alt: Travis tests status
251-
:align: middle
252-
253-
.. |appveyor-badge-icon| image:: https://ci.appveyor.com/api/projects/status/github/nexB/license-expression?svg=true
254-
:target: https://ci.appveyor.com/project/nexB/license-expression
255-
:alt: Appveyor tests status
256-
:align: middle
257-
258-
.. |azure-badge-icon| image:: https://dev.azure.com/nexB/license-expression/_apis/build/status/nexB.license-expression?branchName=master
259-
:target: https://dev.azure.com/nexB/license-expression/_build/latest?definitionId=2&branchName=master
260-
:alt: Azure pipelines tests status
261-
:align: middle
262-

docs/source/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import pathlib
1313
import sys
1414

15-
srcdir = pathlib.Path(__file__).resolve().parents[2].joinpath('src')
15+
srcdir = pathlib.Path(__file__).resolve().parents[2].joinpath("src")
1616
sys.path.insert(0, srcdir.as_posix())
1717

1818
# -- Project information -----------------------------------------------------
@@ -40,7 +40,7 @@
4040

4141
# FIXME: including AND, NOT and OR will result in endless recursion
4242
autodoc_default_options = {
43-
'exclude-members': 'AND, NOT, OR',
43+
"exclude-members": "AND, NOT, OR",
4444
}
4545

4646

@@ -61,7 +61,7 @@
6161
}
6262

6363
# Setting for sphinxcontrib.apidoc to automatically create API documentation.
64-
apidoc_module_dir = srcdir.joinpath('license_expression').as_posix()
64+
apidoc_module_dir = srcdir.joinpath("license_expression").as_posix()
6565

6666
# Reference to other Sphinx documentations
6767
intersphinx_mapping = {

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Welcome to license-expressions's documentation!
77

88
readme_link
99
API<api/modules>
10+
contribute/contrib_doc
1011

1112
Indices and tables
1213
==================

0 commit comments

Comments
 (0)