Skip to main content

Code that is used by the backend and Python APIs for diffify.com

Project description

diffify-lib

For Developers

Environment set up

From this directory (./diffify-lib/ in the repository), to load the developer environment for this package:

  • Install poetry: pip install poetry
  • Install the 'dev' dependencies: poetry install

Then activate the environment:

# poetry >= 2
source .venv/bin/activate
# poetry < 2
poetry shell

From here you can open VS code, and have the environment preloaded.

Continuous Integration

We use the JR Common CI routines in GitLab CI runs. To update the template, use

copier copy https://gitlab.com/jumpingrivers/lib/templates/common-ci .

Note that we have additional routines beyond the Common CI core, for running pytest, mypy and for deploying the package to PyPI.

Tests

Unit tests can be ran without further set up:

pytest tests/unit

To run the integration tests, you'll need some environment variables defined:

  • S3_KEY_DEV
  • S3_SECRET_DEV
  • S3_BUCKET_DEV
  • S3_URL_DEV

Contact the diffify devs if you need these secrets. The simplest way to use these secrets locally is to store them in a file .dev.env (do not add this file to version control) and load that file into your working environment before running the tests:

env $(cat .dev.env) pytest tests/unit tests/integration

Note that the integration tests will be run in GitLab's CI runners, so you may not need to have access to these secrets.

Version numbers

Any pull request that modifies the source code should have an associated version bump to the package. When this happens you should change the version in two places:

  • [tool.poetry] section of pyproject.toml
  • __version__ declaration in diffify_lib/__init__.py

A simple way to keep the version numbers in sync is to use:

poetry version patch|minor|major

This requires that poetry-bumpversion is installed alongside poetry.

Pre-commit hooks

A pre-commit suite is defined in the root of this repository. You are strongly advised to use these hooks during development. To register the hooks with your local copy of the repository, run the following (from the repo-root):

# Install pre-commit itself
pip install pre-commit
# Install the hooks that pre-commit runs
pre-commit install

Now, pre-commit will run on your code at every commit, maintaining the style and quality of the code.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffify_lib-0.2.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffify_lib-0.2.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file diffify_lib-0.2.0.tar.gz.

File metadata

  • Download URL: diffify_lib-0.2.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.18 Linux/6.8.0-1031-aws

File hashes

Hashes for diffify_lib-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8b2dbf9227116ce1e59b5e58c344d9e33613b8c0e5dcc0e92074aa68b7c56864
MD5 52116e1111577f200347ebdd64ea51b0
BLAKE2b-256 60121cc8ca49b960c4108f729eb3075e437e0729850f62d9a790afb0ad0ffa1a

See more details on using hashes here.

File details

Details for the file diffify_lib-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: diffify_lib-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.18 Linux/6.8.0-1031-aws

File hashes

Hashes for diffify_lib-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9563330869b45069c890d3209891979339e8fb1825ec47bac46390849135d4d
MD5 0632daa79c260022796a7859c02e7eea
BLAKE2b-256 0b5a5eff113558eded50d8504c3734228528cb73e1753e592cb76d8d798a6f9c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page