Package: kaito-model
How to create a new python project with projenrunpj new python --name=kaito_model(pjis an alias fornpx projen)configure.projenrc.pyby adding belowproject=PythonProject(...homepage="",license=None,project_type=ProjectType.LIB,# or ProjectType.APP if this is not a librarypip=False,venv=False,setuptools=False,poetry=True,poetry_options={"repository":"https://github.com/MetaSearch-IO/KaitoModelPython.git",},deps=["python@^3.9",],)Note that python dependency is required bypoetryand the version should be at least 3.7increase the version in.projenrc.pyif necessary.setup the poetry environment by runningpoetry env use <PATH_TO_PROJECT>/.env/bin/python3.9(or your desired python version)seepoetry docsfor the exact env path.you may also need to change the IDE interpreter to the same path, otherwise the IDE will not be able to find the dependencies.runpj buildto install dependencies and generate artifacts.if not already, setup pypi main token bypoetry config pypi-token.pypi <main-token>, find main token innotion docrunpj publishto upload a new version topypi.How to adopt projen to an existing python projectrunpj new python, the script will recognize your project name and create a.projenrc.pyfile.delete the content inside the newly created<project-name>folder, move content fromsrc(or other folder name with existing source files) to<project-name>, and delete thesrcfolder. Move the test files to<project-name>/testsas well.you may want to change themodule_namein.projenrc.py, note that only lowercase letters and underscores are allowed.refer toHow to create a new python project with projenstep 2 till the end, configure the.projenrc.pyfile.additionally, you need to base on the existingsetup.cfg(orrequirements.txt), add the dependencies to.projenrc.pyfile. Then delete thesetup.cfg(orrequirements.txt) file.How to automate the release processcreate a project specificpypi tokenwithreposcope, and add it to the github secrets asPYPI_API_TOKEN. Or ask your admin to do it for you.BonusHow to enforce pre commit actions (for any language)installpre-commitand add pre-commit to deps list.create a pre-commit configuration file.pre-commit-config.yamlsimilar to below# See https://pre-commit.com for more information# See https://pre-commit.com/hooks.html for more hooksrepos:-repo:https://github.com/pre-commit/pre-commit-hooksrev:v3.2.0hooks:-id:trailing-whitespace-id:end-of-file-fixerexclude:^\.*# Most dot files managed by projen and are read only-id:check-yaml-id:check-added-large-filesrunpre-commit install(optional) runpre-commit autoupdateto update hooks to the latest versionHow to run github actions locallyinstallact(optional) create an act environment variables fle.actenvwith extra env variables, some examples could beGITHUB_TOKEN=<your-github-token>PYPI_API_TOKEN=<your-pypi-token>Note that act will try to load file.envas environment variables, but it will not work because.envnow it's a virtual environment folder managed by projen. So we need to create a new file.runact --env-file .actenvto run the github actions locally.the first time runactwill let you choose default image, you should choose at leastMediumimage.make an alias for this command for easier usealias act='act --env-file .actenv'TODO: Runprojenas pre-commit hook to ensure the project is up to dateTODO: Auto bump the version number