This section is for if you want to run the package in development, and get involved by making a code contribution.
Clone the repository:
git clone https://github.com/vemonet/rdflib-endpoint
cd rdflib-endpoint
Install Hatch, this will automatically handle virtual environments and make sure all dependencies are installed when you run a script in the project:
pipx install hatch
Install the dependencies in a local virtual environment (running this command is optional as hatch
will automatically install and synchronize dependencies each time you run a script with hatch run
):
hatch -v env create
The API will be automatically reloaded when the code is changed:
hatch run dev
Access the YASGUI interface at http://localhost:8000
Make sure the existing tests still work by running the test suite and linting checks. Note that any pull requests to the fairworkflows repository on github will automatically trigger running of the test suite:
hatch run test
To display all print()
:
hatch run test -s
You can also run the tests on multiple python versions:
hatch run all:test
The code will be automatically formatted when you commit your changes using pre-commit
. But you can also run the script to format the code yourself:
hatch run fmt
In case you are facing issues with dependencies not updating properly you can easily reset the virtual environment with:
hatch env prune
The deployment of new releases is done automatically by a GitHub Action workflow when a new release is created on GitHub. To release a new version:
-
Make sure the
PYPI_TOKEN
secret has been defined in the GitHub repository (in Settings > Secrets > Actions). You can get an API token from PyPI at pypi.org/manage/account. -
Increment the
version
number following semantic versioning, select betweenfix
,minor
, ormajor
:hatch version fix
-
Commit the new version, and create a new release on GitHub, which will automatically trigger the workflow to publish the new release to PyPI.
You can also manually trigger the workflow from the Actions tab in your GitHub repository webpage if needed.