Developing python projects associated with git-pull.com all use the same structure and workflow. At a later point these will refer to that website for documentation.
Clone:
$ git clone https://github.com/vcs-python/vcspull.git$ cd vcspullInstall packages:
$ uv sync --all-extras --devpytest is used for tests.
via pytest-watcher (works out of the box):
$ make startvia entr(1) (requires installation):
$ make watch_test$ uv run py.testor:
$ make testVerify that the published wheel runs without dev/test extras:
$ uvx --isolated --reinstall --from . python scripts/runtime_dep_smoketest.pyThe script imports every vcspull module and exercises each CLI sub-command
with --help. There is also a pytest wrapper guarded by a dedicated marker:
$ uv run pytest -m scripts__runtime_dep_smoketest scripts/test_runtime_dep_smoketest.pyThese checks are network-dependent because they rely on uvx to build the
package in an isolated environment.
PYTEST_ADDOPTS can be set in the commands below. For more
information read docs.pytest.com for the latest documentation.
Verbose:
$ env PYTEST_ADDOPTS="-verbose" make startDrop into pdb on first error:
$ env PYTEST_ADDOPTS="-x -s --pdb" make startIf you have ipython installed:
$ env PYTEST_ADDOPTS="--pdbcls=IPython.terminal.debugger:TerminalPdb" \
make startsphinx is used for documentation generation. In the future this may change to docusaurus.
Default preview server: http://localhost:8022
sphinx-autobuild will automatically build the docs, it also handles launching a server, rebuilding file changes, and updating content in the browser:
$ cd docs$ make startIf doing css adjustments:
$ make designRebuild docs on file change (requires entr(1)):
$ cd docs$ make devIf not GNU Make / no -J support, use two terminals:
$ make watch$ make serve$ cd docsBuild:
$ make htmlLaunch server:
$ make serveThe project uses ruff to handle formatting, sorting imports and linting.
uv:
```console
$ uv run ruff check .
```
If you setup manually:
```console
$ ruff check .
```
```console
$ make ruff
```
```console
$ make watch_ruff
```
requires [`entr(1)`].
uv:
```console
$ uv run ruff check . --fix
```
If you setup manually:
```console
$ ruff check . --fix
```
ruff format is used for formatting.
uv:
```console
$ uv run ruff format .
```
If you setup manually:
```console
$ ruff format .
```
```console
$ make ruff_format
```
mypy is used for static type checking.
uv:
```console
$ uv run mypy .
```
If you setup manually:
```console
$ mypy .
```
```console
$ make mypy
```
```console
$ make watch_mypy
```
requires [`entr(1)`].
See `[tool.mypy]` in pyproject.toml.
```{literalinclude} ../pyproject.toml
:language: toml
:start-at: "[tool.mypy]"
:end-before: "[tool"
```
uv handles virtualenv creation, package requirements, versioning, building, and publishing. Therefore there is no setup.py or requirements files.
Update __version__ in __about__.py and pyproject.toml::
git commit -m 'build(vcspull): Tag v0.1.1'
git tag v0.1.1
git push
git push --tags
GitHub Actions will detect the new git tag, and in its own workflow run uv build and push to PyPI.