-
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-commit
hook, 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-commit
hook, 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
docs
service -
.github/workflows/pytest.yml
callstests/run.sh
on every commit
Python package setup
-
package_name/
dir:__init__.py
(empty) -
.devcontainer/postAttach.sh
, install the local package into the devcontainer -
setup.py
in the root, just import and callsetuptools.setup()
(with no args) -
setup.cfg
in the root, most configuration info about package -
[build-system]
entry inpyproject.toml
Repository setup
-
.gitignore
with 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": false
Docs
- Add
mkdocstrings
for automatic code documentation generation
Metadata
Metadata
Assignees
Labels
No labels