Skip to content

Latest commit

 

History

History
78 lines (49 loc) · 2.38 KB

DEVELOPMENT.md

File metadata and controls

78 lines (49 loc) · 2.38 KB

Development

git-remote-dropbox uses the Hatch project manager (installation instructions).

Hatch automatically manages dependencies and runs type checking, formatting/linting, and other operations in isolated environments.

Testing

git-remote-dropbox has integration tests written in shell scripts. The tests exercise git-remote-dropbox via git operations, so the tests interact with the filesystem. For this reason, it is recommended that tests are run inside a Docker container (or in CI).

To run the tests, first start a Docker container:

docker run -it --rm -v "${PWD}:/git-remote-dropbox" -w /git-remote-dropbox python:3.13-bookworm /bin/bash

Now, inside the Docker container, install the git-remote-dropbox package:

pip install -e .

Next, set the DROPBOX_TOKEN environment variable (to your long-lived access token). This is required because the tests actually interact with the real Dropbox API.

export DROPBOX_TOKEN='...'

Finally, run the tests:

tests/test.sh

Type checking

You can run the mypy static type checker with:

hatch run types:check

Formatting and linting

You can run the Ruff formatter and linter with:

hatch fmt

This will automatically make safe fixes to your code. If you want to only check your files without making modifications, run hatch fmt --check.

Packaging

You can use hatch build to create build artifacts, a source distribution ("sdist") and a built distribution ("wheel").

You can use hatch publish to publish build artifacts to PyPI.

Continuous integration

Testing, type checking, and formatting/linting is checked in CI.