Package: anyjsonthing
anyjsonthing🧐 AboutThis repository contains the code ofanyjsonthing, a Python library that implements serialization of simple data
objects as JSON data.
For additional details on how to use the library, please have a look at the enclosed documentation.
(Notice that you currently have to build the documentation by yourself, as described below.)NOTICE:All tickets related to this project are availableon JIRA.🏁 Getting StartedThe repository usesjust(a build tool likeMakefile) to automate common tasks such
as testing, building, etc.
To list all available recipes, run the following command in the project directory:$just-l
Availablerecipes:build-docs# Builds the documentation.build-library# Builds the anyjsonthing library.clean# Cleans up all generated files.dev-env# Creates a Conda environment (called "anyjsonthing") for local development/testing.print-version# Prints the currently specified version of the library.publish-library# Publishes the library in the PyPI.test# Runs all unit tests in the test directory.test-publish-library# Publishes the library in the TestPyPI.Notice the recipedev-env(which can be executed by runningjust dev-env), which creates aCondaenvironment (calledanyjsonthing) that contains all dependencies required
for local development and testing.🚀 Building & PublishingThere are ready-madejustrecipes for all build tasks:just build-library– Builds the library using Python's standardbuildmodule.
The resulting files are placed in thedistfolder, which is created in the project root.just publish-library– Publishes the built library in the PyPI.
Notice that this recipe automatically runs thebuild-libraryrecipe first.
Furthermore, please notice the required configuration, as described below.just test-publish-library– This recipe exist for testing purposes and is identical to thepublish-libraryrecipe
except that it publishes the library in the TestPyPI.
Again, please consider the required configuration.just build-docs– Builds the documentation of the library, which is placed indocs/build.In this repository, we follow the convention that the version of the library (as published in the PyPI) is specified in
the Python moduleversion.pylocated in the project root.
Hence, you should never have any need to directly adjust thesetup.cfg, which configures the details of the build
process used to assemble the created Python package.🏗 CI/CDThis project makes use of a simple CI/CD pipeline that consists of the following steps:On every push, all unit tests in the test directory (src/test) are executed usingjust test.If a push occurred on themainbranch and the tests finished successfully, then the library is automatically built
and published in the PyPI. Furthermore, the respective commit is tagged with the published version of the library
(i.e.,vX.Y.Z).⚙️ ConfigurationThe CI/CD pipeline of this project requires the following secrets (for GitHub actions) to be in place:SecretDescriptionPYPI_TOKENThe access token of the PyPI account that is used for publishing the library.For local building and publishing, you further need to specify the following configuration values in an env file called.env(without any name before the dot!), which has to be located in the project root:Env VariableDescriptionPYPI_TOKENThe access token of the PyPI account that is used for publishing the library.PYPI_TEST_TOKENThe access token of the TestPyPI account that is used for testing publishing of the library.✍️ AuthorsPatrick Hohenecker (patrick.hohenecker@gmx.at)