Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
de8b239
PEP 639: Implement License-Expression and License-File
ewdurbin Sep 3, 2024
44beda7
wire in vendoring library to manage vendored dependencies
ewdurbin Sep 3, 2024
2b1a9f7
vendor license_expression and boolean.py
ewdurbin Sep 3, 2024
9bfa714
harmonize with documentation
ewdurbin Sep 3, 2024
1aea212
exclude vendored spdx data from sdist/whl. build/bring our own
ewdurbin Sep 4, 2024
cec33f1
migrate to parser based on hatchling's
ewdurbin Sep 4, 2024
cfb3af1
string -> re
ewdurbin Sep 4, 2024
d6b47d5
License-File: disallow unresolved globs and non-relative paths
ewdurbin Sep 5, 2024
a55f422
Merge branch 'main' into pep_639
brettcannon Sep 11, 2024
afa5d4c
Apply suggestions from code review
ewdurbin Sep 13, 2024
396e4ef
update typing for licenses.spdx
ewdurbin Sep 13, 2024
21a2821
Extend typing improvements in licenses.spdx to include Exception
ewdurbin Sep 13, 2024
4ac18f0
fixup names, Exception is not a good one.
ewdurbin Sep 13, 2024
46a7491
better enforcement of license-file paths
ewdurbin Sep 13, 2024
cd7105f
subclass ValueError for invalid license expressions
ewdurbin Sep 13, 2024
e469b7e
and empty license expression is invalid
ewdurbin Sep 13, 2024
e699391
create a "NormalizedLicenseExpression" type
ewdurbin Sep 13, 2024
22fa9cd
rename normalize -> canonicalize
ewdurbin Sep 13, 2024
f952ab9
add tests to ensure license and exception ids conform
ewdurbin Sep 13, 2024
30e34f1
update name of var
ewdurbin Sep 13, 2024
8906b16
match formatting standards
ewdurbin Sep 13, 2024
a361294
reorganize the licenses module a bit
ewdurbin Sep 15, 2024
9cee38e
apply code-review suggestions for update_licenses task
ewdurbin Sep 15, 2024
81efbda
fix tests after spdx module was made private
ewdurbin Sep 15, 2024
701217b
add docs
ewdurbin Sep 15, 2024
4539543
Merge branch 'main' into pep_639
brettcannon Sep 16, 2024
64d3647
add additional test cases and handle LicenseRef- identifiers not alre…
ewdurbin Sep 19, 2024
6e6b304
Apply suggestions from code review
ewdurbin Oct 3, 2024
a65ca89
nit
ewdurbin Oct 3, 2024
1cac177
fixups from code-review suggestions
ewdurbin Oct 3, 2024
42d6452
pass globals/locals to eval
ewdurbin Oct 3, 2024
461d183
Merge branch 'main' into pep_639
brettcannon Oct 7, 2024
9546938
fix: unncessary string concatenation from reformatting
ewdurbin Oct 8, 2024
da3f04b
licenses: add some testcases for whitespace normalization
ewdurbin Oct 8, 2024
23df2ac
lint
ewdurbin Oct 8, 2024
042a335
Merge branch 'main' into pep_639
ewdurbin Oct 24, 2024
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
Prev Previous commit
Next Next commit
migrate to parser based on hatchling's
- back away from vendoring
- adapt hatchling's license expression parser to accept well-formed LicenseRef-
- back to python storage of license data
  • Loading branch information
ewdurbin committed Sep 5, 2024
commit cec33f13db5a275d2ad3e349cd1a6a56397d7b35
4 changes: 1 addition & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ repos:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
exclude: '^src/packaging/_vendor'
- id: trailing-whitespace
exclude: '^src/packaging/_vendor'

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
hooks:
- id: mypy
exclude: '^(docs|tasks|tests)|setup\.py|^src/packaging/_vendor'
exclude: '^(docs|tasks|tests)|setup\.py'
args: []
additional_dependencies: [pyparsing, nox]

Expand Down
29 changes: 3 additions & 26 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# mypy: disallow-untyped-defs=False, disallow-untyped-calls=False

import argparse
import contextlib
import datetime
import difflib
Expand Down Expand Up @@ -182,32 +181,10 @@ def release(session):
webbrowser.open("https://github.com/pypa/packaging/releases")


# NOTE: This session will COMMIT upgrades to vendored libraries.
# You should therefore not run it directly against `main`. If you
# do (assuming you started with a clean main), you can run:
#
# git checkout -b vendoring-updates
# git checkout main
# git reset --hard origin/main
@nox.session
def vendoring(session: nox.Session) -> None:
# Ensure that the session Python is running 3.10+
# so that truststore can be installed correctly.
session.run(
"python", "-c", "import sys; sys.exit(1 if sys.version_info < (3, 10) else 0)"
)

parser = argparse.ArgumentParser(prog="nox -s vendoring")
parser.add_argument("--upgrade-all", action="store_true")
parser.add_argument("--upgrade", action="append", default=[])
parser.add_argument("--skip", action="append", default=[])
args = parser.parse_args(session.posargs)

session.install("vendoring~=1.2.0")

if not (args.upgrade or args.upgrade_all):
session.run("vendoring", "sync", "-v")
return
def update_licenses(session: nox.Session) -> None:
session.install("httpx")
session.run("python", "tasks/licenses.py")


# -----------------------------------------------------------------------------
Expand Down
28 changes: 2 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,11 @@ Source = "https://github.com/pypa/packaging"

[tool.flit.sdist]
include = ["LICENSE*", "tests/", "docs/", "CHANGELOG.rst"]
exclude = ["docs/_build", "tests/manylinux/build-hello-world.sh", "tests/musllinux/build.sh", "tests/hello-world.c", "tests/__pycache__", "build/__pycache__", "src/packaging/_vendor/license_expression/data/*"]

[tool.pytest.ini_options]
addopts = [
"--ignore=src/packaging/_vendor"
]
exclude = ["docs/_build", "tests/manylinux/build-hello-world.sh", "tests/musllinux/build.sh", "tests/hello-world.c", "tests/__pycache__", "build/__pycache__"]


[tool.coverage.run]
branch = true
omit = [
"*/_vendor/*"
]

[tool.coverage.report]
exclude_lines = ["pragma: no cover", "@abc.abstractmethod", "@abc.abstractproperty"]
Expand All @@ -65,21 +57,12 @@ warn_unused_ignores = true
module = ["_manylinux"]
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = ["packaging._vendor.*"]
ignore_errors = true
follow_imports = "skip"
ignore_missing_imports = true

[tool.ruff]
src = ["src"]
extend-exclude = [
"_vendor"
"src/packaging/licenses/spdx.py"
]

[tool.ruff.lint.isort]
known-third-party = ["packaging._vendor"]

[tool.ruff.lint]
extend-select = [
"B",
Expand Down Expand Up @@ -114,10 +97,3 @@ ignore = [
"ISC001",
"ISC002",
]

[tool.vendoring]
destination = "src/packaging/_vendor/"
requirements = "src/packaging/_vendor/vendor.txt"
namespace = "packaging._vendor"

protected-files = ["__init__.py", "README.rst", "vendor.txt"]
1 change: 0 additions & 1 deletion src/packaging/_spdx.json

This file was deleted.

Empty file removed src/packaging/_vendor/__init__.py
Empty file.
23 changes: 0 additions & 23 deletions src/packaging/_vendor/boolean.py.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/packaging/_vendor/boolean.pyi

This file was deleted.

30 changes: 0 additions & 30 deletions src/packaging/_vendor/boolean/__init__.py

This file was deleted.

Loading