-
Notifications
You must be signed in to change notification settings - Fork 2
Developper instructions
Florian Blanchet edited this page Apr 2, 2023
·
20 revisions
git clone https://github.com/NotANameServer/incipyt
cd incipyt
python -m venv --upgrade-deps .env
source .env/bin/activate
python -m pip install -e ".[test]"
py -m venv --upgrade-deps .env
.\.env\Scripts\activate
python -m pip install -e ".[test]"
Note: To activate virtual environments in Windows PowerShell, script execution has to be enabled on your system. You can enable it with:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
pre-commit install --install-hooks --overwrite
You can test pre-commit with pre-commit run --all-files
.
Also install pre-commit globally (pipx install pre-commit
).
{
"editor.formatOnSave": true,
"git.allowForcePush": true,
"git.confirmForcePush": false,
"python.disableInstallationCheck": true,
"python.formatting.blackPath": ".env/bin/black",
"python.formatting.provider": "black",
"python.linting.flake8CategorySeverity.W": "Error",
"python.linting.flake8Enabled": true,
"python.linting.flake8Path": ".env/bin/flake8heavened",
"python.terminal.activateEnvInCurrentTerminal": true,
"python.testing.pytestArgs": [
"tests",
"-vv",
"--cov=incipyt",
"--cov-report=xml",
],
"python.testing.pytestEnabled": true,
"python.testing.pytestPath": ".env/bin/pytest",
}
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Tests",
"type": "python",
"request": "test",
"env": {
"PYTEST_ADDOPTS": "--no-cov"
}
}
]
}
# With coverage
python -m pytest -vv --cov=incipyt --cov-report=xml tests
# Without coverage
python -m pytest -vv tests
python -m black incipyt
python -m flakeheaven lint incipyt
python -m build --no-isolation
Commit your changes using Conventional Commits
feat: project initialization
We decided to use pep517 pyproject.toml with flit, we decided to use
pre-commit to automate linting and stuff.
We decided to use flit over setuptools, poetry and pdm because it is
mostly pep517 and pep621 compatible (unless setuptools) and it just does
the job of building and publishing the package (unless poetry and pdm).
We decided to use pre-commit with a large range of linters to ease the
development between contributors. Among the "stuff" we enabled are: file
sanitizers (line endind, useless whitespaces, line line at end of file),
file checker (python, toml, yaml), linter and formatter (python) and
some security watchdogs (don't commit those private keys!).
We decided to use pytest over unittest, we just want to give that
framework a try. We decided to use the boring sphinx because nothing
else seems funny enough to us.
Closes #3