A [simple] [general-purpose] Python template ππππ¦
I used this template for fesenjoon and medviz.
-
Linux and Mac Use GCC Makefile
-
Install Makefile
Set a name for the package:
make init newNameTo use env in pool:
make envThere is no need to active virtual environment when the PY command is used from Makefile.
To use env here (local directory)
make env-local source env_platform_ver/bin/activateCheck Python and pip version
makeUpdate pip and build tools
make checkInstall the requirements
make pireq make piu numpy matplotlib scipy- Linter: Pylint
- Formatter: Black
- CI: GitHub Actions
- Formatter: Black + isort
- Type checker: MyPy
- Linter: Ruff
- Linter: Pylint
- GitHub Actions
- Git Hooks
- PyPI Publish
- Flit
- Poetry
- Ruff
Git hooks are available in ./scripts/.githooks
chmod +x ./scripts/.githooks/script
git config core.hooksPath ./scripts/.githooks
- To build a package, run:
make pkg-build- To check the build, run:
make pkg-check- To install the package locally, run:
make pkg-install- Create
.pypircfile in the root directory of the project. It should look like this:
[distutils]
index-servers =
pypi
testpypi
[pypi]
repository: https://upload.pypi.org/legacy/
username: <your username>
password: <your password>
[testpypi]
repository: https://test.pypi.org/legacy/
username: <your username>
password: <your password>- To publish to PyPI, run:
make pkg-publish