Skip to content

Geomatys/python-project-template

Repository files navigation

Python project template

An example to help create and maintain a new Python project. Detailed documentation about the project structure lies in about page.

Requirements

  • Python >= 3.10
  • Python venv
  • Make 4 or higher

Build

Use command make. It will:

  1. Create or update the project virtual environment according to the dependencies declared in Python project descriptor.
  2. Build a wheel file in dist directory.

Test

Once you have built the project, launch make test.

Contribute

  1. Build project: make
  2. Activate pre-commit checks: pre-commit install
  3. Push production code in src/<my_package_name>.
  4. Push test code in tests directory.

Test resources

If you require access to additional files from tests, you can push them in test resource directory. You can then access them like this:

from tests.resources import resources_dir as resources

resource_file = resources / "my-folder" / "my-file"

with open(resource_file, mode="r") as file_stream:
    # process file
    pass

WARNING: Beware of pushed file size ! Large files may bloat the git repository.

Manually launch pre-commit checks

To execute pre-commit checks on the entire repository (i.e. check all source files, not only your local changes), use make check.

About

An example project to show how to structure distribuable Python projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published