Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
b65812b
Initial check-in of purl type definition support
stevespringett Mar 1, 2025
d5d170e
Added index and doc generation
stevespringett Mar 1, 2025
4e5ae33
Removed description from index and added note to all docs
stevespringett Mar 1, 2025
532f7d2
Updated Maven definition
stevespringett Mar 1, 2025
d13aefd
Simplified case normalization
stevespringett Mar 1, 2025
950dc67
Added npm definition
stevespringett Mar 1, 2025
aa5fb80
Added auto-generated files - these will be overwritten once the GitHu…
stevespringett Mar 1, 2025
59347ce
Added SWID definition
stevespringett Mar 1, 2025
e1833aa
Change README files case
pombredanne Jul 2, 2025
305664c
Remove description from the index
pombredanne Jul 2, 2025
254c0b3
Remove URL from index.
pombredanne Jul 2, 2025
3ba7bf9
Improve JSON schema definition
pombredanne Jul 2, 2025
5c1e926
Update schemas to separate tests
pombredanne Jul 7, 2025
1e154c8
Improve schemas
pombredanne Jul 13, 2025
d305de2
Refine .ignore
pombredanne Jul 13, 2025
4c3b4e6
Move doc script to etc/ directory
pombredanne Jul 13, 2025
6a92f1c
Make license text usable as a code header
pombredanne Jul 13, 2025
f5f3ab4
Rename purl-type.schema.json
pombredanne Jul 13, 2025
d564f48
Rename index to plural
pombredanne Jul 13, 2025
95ceb9e
Rename definition with a proper name suffix
pombredanne Jul 13, 2025
3816f76
Refine schema organization
pombredanne Jul 13, 2025
2f4f849
Add new Makefile and dev doc
pombredanne Jul 13, 2025
74ba309
Update doc
pombredanne Jul 13, 2025
8b36064
Update type docs
pombredanne Jul 13, 2025
30e46cb
Rename generated definitions with better name
pombredanne Jul 13, 2025
ad7b048
Ensure check pass
pombredanne Jul 13, 2025
a963c48
Improve code formatting
pombredanne Jul 13, 2025
5f7cbba
Refine description of schema elements
pombredanne Jul 14, 2025
d08e581
Format schema
pombredanne Jul 14, 2025
9870507
Format JSON
pombredanne Jul 14, 2025
f42bd5f
Add extra tools as dependencies
pombredanne Jul 14, 2025
311be40
Add script to format JSON
pombredanne Jul 14, 2025
4a5afca
Improve code generation
pombredanne Jul 14, 2025
77a7d1c
Improve formating and more
pombredanne Jul 14, 2025
483f481
Move docs to the root of the repo as types-doc
pombredanne Jul 14, 2025
c326ed2
Add generated code for schemas
pombredanne Jul 14, 2025
074f595
Rename PURL types index
pombredanne Jul 14, 2025
ae597d3
Improve PURL types index schema
pombredanne Jul 14, 2025
29d3dd3
Is case senstive has a default
pombredanne Jul 14, 2025
0767bd4
Add new type index
pombredanne Jul 14, 2025
3e20728
Make doc generation work
pombredanne Jul 14, 2025
df4bb5f
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
8913ce1
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
b2d514f
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
74e6d92
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
c443a22
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
b8c73d7
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
dafabe7
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
5665c22
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
25c498e
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
2b27bcf
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
f46c433
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
d92ba8e
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
9945f62
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
525ce13
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
1f5dd84
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
23d2f98
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
b33c631
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
0368e13
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
0fc12ff
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
f9ac30a
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
0ef6523
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
aa01afa
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
12e9ea7
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
6becb1d
* Copy test-suite-data.json to splits/gem-test.json splits/deb-test.j…
pombredanne Jul 14, 2025
d88ea14
Copy test-suite-data.json to splits/gem-test.json splits/deb-test.jso…
pombredanne Jul 14, 2025
22db397
Use only type-specific tests.
pombredanne Jul 14, 2025
4e41afd
Rename splits to tests
pombredanne Jul 14, 2025
a60f052
Move early JSON types tests to own subdirectory
pombredanne Jul 14, 2025
6ae390b
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
b5661f5
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
add3402
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
9ce0a98
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
d59a6f3
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
e94a22f
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
6f025ca
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
64567c9
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
35d47e0
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
54bb868
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
dca3030
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
65f295d
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
0bf7e26
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
e932f0a
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
002e380
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
9d97a3c
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
829f026
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
6ff388e
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
d17fdf3
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
a256d0b
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
f1d91a5
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
dc386aa
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
736ce84
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
938bc86
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
23c377b
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
394e5c1
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
3f2e740
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
313b572
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
9549345
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
2f70e7a
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
3bb254a
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
afea29d
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
7a9b8bd
* Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definit…
pombredanne Jul 14, 2025
b494f98
* Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definit…
pombredanne Jul 14, 2025
655459f
Copy PURL-TYPES.rst to types/alpm-definition.json types/apk-definitio…
pombredanne Jul 14, 2025
1d6931e
Remove definitions not specific to a type
pombredanne Jul 14, 2025
9d7251a
Add script to split files
pombredanne Jul 14, 2025
cfd4c01
Clarify that a repository url is for the default
pombredanne Jul 14, 2025
5c9c5d5
Move repository 1st
pombredanne Jul 14, 2025
46a7b7a
Add formatted type defs
pombredanne Jul 14, 2025
a8f542b
Remove double backticks
pombredanne Jul 14, 2025
aa1f697
Format JSON test files
pombredanne Jul 14, 2025
3215796
Remove older test files
pombredanne Jul 14, 2025
615e5a6
Use note and description consistently
pombredanne Jul 14, 2025
d8a1cf4
Focus checks and gen on subset of valid JSON types
pombredanne Jul 14, 2025
4968f6a
Ignore dev cache
pombredanne Jul 14, 2025
e1ab37a
Complete type def conversion to JSON
pombredanne Jul 14, 2025
8656191
Make all type def schema valid
pombredanne Jul 14, 2025
39c34e5
Generate all docs
pombredanne Jul 14, 2025
c497de2
Rename is_case_sensitive to case_sensitive
pombredanne Jul 14, 2025
ed0d249
Convert tests to new format
pombredanne Jul 15, 2025
a5726ba
Do not checkjson when generating code
pombredanne Jul 15, 2025
3f92e2b
Ignore pycache
pombredanne Jul 15, 2025
7f1a975
Format JSON
pombredanne Jul 15, 2025
955ab87
Add missing test Python code
pombredanne Jul 15, 2025
d818185
Add new feature to generate tests from examples
pombredanne Jul 15, 2025
18b23c6
Extend tests for all types
pombredanne Jul 15, 2025
eb00742
Enable schema validation for test files
pombredanne Jul 15, 2025
70b3f04
Check for duplicated tests
pombredanne Jul 15, 2025
a9ba953
Merge branch 'main' into purl_type_schema-refined
pombredanne Jul 15, 2025
2821916
Refine tests
pombredanne Jul 16, 2025
5551749
Move config file to scripts
pombredanne Jul 25, 2025
82c0ab0
Move requirements to etc/scripts
pombredanne Jul 25, 2025
0880e81
Improve ignore file
pombredanne Jul 25, 2025
2cba852
Remove all backticks from type definitions
pombredanne Jul 25, 2025
cfa0205
Remove URL decoration
pombredanne Jul 25, 2025
97d4ac4
Fix typo in npm type comment
pombredanne Jul 25, 2025
9c6898a
Improve readbility for command example
pombredanne Jul 25, 2025
b1e8288
Update .github/workflows/generate-index-and-docs.yml
pombredanne Jul 25, 2025
9c655f9
Update Makefile
pombredanne Jul 25, 2025
c5ed010
Move type tests to their own directory
pombredanne Jul 25, 2025
7aa181f
Move spec tests to their own directory
pombredanne Jul 25, 2025
1c45ea4
Rename None tests to spec tests
pombredanne Jul 25, 2025
2e39451
Merge branch 'purl_type_schema-refined' of https://github.com/package…
pombredanne Jul 25, 2025
a9ef4e1
Checlk JSON in new directory structure
pombredanne Jul 25, 2025
ab53664
Regenerated types documentation
pombredanne Jul 25, 2025
496e6ff
Move purl-types-index.json at the root
pombredanne Jul 25, 2025
fa559bc
Update purl-types-index.json path references
pombredanne Jul 25, 2025
de752b1
Merge branch 'main' into purl_type_schema-refined
pombredanne Jul 25, 2025
8a699a9
Removing old test suite
pombredanne Jul 25, 2025
526126f
Remove old type definitions
pombredanne Jul 25, 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
45 changes: 45 additions & 0 deletions .github/workflows/generate-index-and-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Check and generate PURL Type Docs and Index

on:
push:
paths:
- "types/*.json"
- "schemas/*.json"
- "etc/"
branches:
- main
workflow_dispatch:
# All permissions should be specified at the job level
permissions: { }

jobs:
generate-index-and-docs:
runs-on: ubuntu-latest
permissions:
content: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: make conf

- name: Validate code and data formats
run: make check

- name: Generate index and docs
run: make gendocs

- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add types/ types-doc/
git commit -s -m "Generate updated PURL type documentation" || echo "No changes to commit"
git push
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/tmp/
/venv/
/.python-version
.ruff_cache/
88 changes: 88 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# SPDX-License-Identifier: MIT
# Copyright (c) the purl authors
# Visit https://github.com/package-url/purl-spec and https://packageurl.org for support

PYTHON_EXE?=python3
VENV_LOCATION=venv
ACTIVATE?=. ${VENV_LOCATION}/bin/activate;

CODEGEN?=datamodel-codegen \
--target-python-version 3.10 \
--use-double-quotes \
--use-exact-imports \
--use-standard-collections \
--wrap-string-literal \
--enum-field-as-literal all \
--formatters ruff-format \
--field-constraints \
--disable-timestamp \
--keep-model-order \
--custom-file-header-path LICENSE \
--input-file-type jsonschema \
--output-model-type pydantic_v2.BaseModel

virtualenv:
@echo "-> Bootstrap the virtualenv with PYTHON_EXE=${PYTHON_EXE}"
${PYTHON_EXE} -m venv ${VENV_LOCATION}

conf: virtualenv
@echo "-> Install dependencies"
@${ACTIVATE} pip install -r etc/scripts/requirements.txt

formatcode:
@echo "-> Run Ruff format"
@${ACTIVATE} ruff check --select I --fix
@${ACTIVATE} ruff format
@echo "-> Run Ruff linter"
@${ACTIVATE} ruff check --fix

formatjson:
@echo "-> Format JSON files"
@${ACTIVATE} python etc/scripts/format_json.py schemas/
@${ACTIVATE} python etc/scripts/format_json.py types/
@${ACTIVATE} python etc/scripts/format_json.py tests/

format: formatcode formatjson
@echo "-> Format all files"

checkjson:
@echo "-> Validate JSON schemas"
@${ACTIVATE} check-jsonschema --check-metaschema --verbose schemas/*.json
@echo "-> Validate JSON data files against the schemas"
@${ACTIVATE} check-jsonschema --schemafile schemas/purl-types-index.schema.json --verbose purl-types-index.json
@${ACTIVATE} check-jsonschema --schemafile schemas/purl-type-definition.schema.json --verbose types/*-definition.json
@${ACTIVATE} check-jsonschema --schemafile schemas/purl-test.schema.json --verbose tests/*/*-test.json

checkcode:
@echo "-> Run Ruff linter validation (pycodestyle, bandit, isort, and more)"
@${ACTIVATE} ruff --config etc/scripts/pyproject.toml check
@echo "-> Run Ruff format validation"
@${ACTIVATE} ruff --config etc/scripts/pyproject.toml format --check

check: checkjson checkcode
@echo "-> Run all checks"

clean:
@echo "-> Clean the Python env"
rm -rf .venv/
find . -type f -name '*.py[co]' -delete

gencode:
@echo "-> Generate Python code from schemas"
@${ACTIVATE} ${CODEGEN} \
--input schemas/purl-types-index.schema.json \
--output etc/scripts/purl_types_index.py
@${ACTIVATE} ${CODEGEN} \
--input schemas/purl-type-definition.schema.json \
--output etc/scripts/purl_type_definition.py
@${ACTIVATE} ${CODEGEN} \
--input schemas/purl-test.schema.json \
--output etc/scripts/purl_test.py
@echo "-> Run Black format for generated code"
@${ACTIVATE} black -l 100 --preview --enable-unstable-feature string_processing etc/scripts/*.py

gendocs:
@${ACTIVATE} python etc/scripts/generate_index_and_docs.py


.PHONY: virtualenv conf formatcode formatjson format checkcode checkjson check clean gencode gendocs
Loading