-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Create another template repository, based on this one, with a basic setup for creating a new Python package.
Features
Running list of features to build into this template
Linting
Use flake8 for python code linting:
- configuration in
.flake8 - add to
.devcontainer/requirements.txt - devcontainer plugin, add to
devcontainer.json -
pre-commithook, add to.pre-commit-config.yaml
Formatting
Use black for python code formatting:
- configuration in
pyproject.toml - add to
.devcontainer/requirements.txt - devcontainer plugin, add to
devcontainer.json -
pre-commithook, add to.pre-commit-config.yaml
Testing
Use pytest for python testing
-
tests/dir:__init__.py,conftest.py(empty) -
tests/requirements.txt, install in devcontainer:pytest,pytest-cov,pytest-mock -
tests/run.sh: runs tests with coverage, (re)generates coverage report - Serve coverage report from
docsservice -
.github/workflows/pytest.ymlcallstests/run.shon every commit
Python package setup
-
package_name/dir:__init__.py(empty) -
.devcontainer/postAttach.sh, install the local package into the devcontainer -
setup.pyin the root, just import and callsetuptools.setup()(with no args) -
setup.cfgin the root, most configuration info about package -
[build-system]entry inpyproject.toml
Repository setup
-
.gitignorewith at least:
__pycache__/
.pytest_cache/
.coverage
.DS_Store
.egg-info/
build/Editor settings
- Add the following to
.vscode/settings.json
"[python]": {
"editor.defaultFormatter": "ms-python.python"
},
"python.formatting.provider": "black",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.testing.pytestArgs": ["tests"],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": falseDocs
- Add
mkdocstringsfor automatic code documentation generation
Metadata
Metadata
Assignees
Labels
No labels