Want to contribute to PyLD? Great! Here are a few notes:
-
In general, follow the common PEP 8 Style Guide.
-
Try to make the code pass ruff checks.
make lintorruff check lib/pyld/*- You can also apply automatic fixing and formatting
using
make fmt
-
Use version
X.Y.Z-devin dev mode. -
Use version
X.Y.Zfor releases.
The public documentation site is built with MkDocs Material.
-
Install documentation dependencies:
make docs-install
-
Build the site:
make docs-build
-
Preview documentation locally:
make docs-serve(override port withPORT=8008 make docs-serve)
-
Refresh bundled JSON-LD context files:
make download-bundled-contexts
- Follow the Semantic Versioning guidelines.
$EDITOR CHANGELOG.md: update CHANGELOG with new notes, version, and date.- commit changes
$EDITOR lib/pyld/__about__.py: update to release version and remove-devsuffix.git commit CHANGELOG.md lib/pyld/__about__.py -m "Release {version}."git tag {version}$EDITOR lib/pyld/__about__.py: update to next version and add-devsuffix.git commit lib/pyld/__about__.py -m "Start {next-version}."git push --tags
To ensure a clean package upload to PyPI, use a clean checkout, and run the following:
- For more info, look at the packaging guide.
- Setup an API token. Recommend using a
specific "PyLD" token and set it up as a "repository" in your
~/.pypircfor use in the upload command. - The below builds and uploads a sdist and wheel. Adjust as needed depending on how you manage and clean "dist/" dir files.
git checkout {version}python3 -m buildtwine check dist/*twine upload -r PyLD dist/*
As of early 2020, the process to generate an EARL report for the official JSON-LD Processor Conformance page is:
-
Run the tests on the
json-ld-apiandjson-ld-framingtest repos to generate a.jsonldtest report as explained in README.md -
Use the rdf tool to generate a
.ttl:rdf serialize pyld-earl.jsonld --output-format turtle -o pyld-earl.ttl
-
Optionally follow the report instructions to generate the HTML report for inspection.
-
Submit a PR to the json-ld-api repository with at least the
.ttl.