Skip to main content

Example Package

Project description

biocommons.example Test Package

codecov

This repo provides a template for biocommons Python packages. Here's how to use it:

  1. Click the Use this template button. Name the new repo like "biocommons.something".
  2. Clone your repo locally.
  3. In the repo, type make rename. The new name will be chosen based on the repo name.
  4. Remove this header.
  5. Commit and push.

Installation

To install from pypi: pip install biocommons.example

Developer Setup

Developers must install zsh, which is required by the Makefile. zsh is included by default in MacOS, and is readily available on all modern Linux distributions.

Setup like this:

make devready
source venv/bin/activate

Code reformatting:

make reformat

Install pre-commit hook:

# included in `make devready`, not necessary for new installations
pre-commit install

Test:

make test   # for current environment
make tox    # for all supported versions

Build:

git tag 0.0.0
make build

Try it:

$ python3 -m biocommons.example
Marvin says:
There's only one life-form as intelligent as me within thirty parsecs...

$ marvin-quote
Marvin says:
You think you've got problems? What are you supposed to do if you...

$ ipython
>>> from biocommons.example import __version__, get_quote_from_marvin
>>> __version__
'0.1.dev8+gd5519a8.d20211123'
>>> get_quote()
"The first ten million years were the worst, ...

Features

Code structure and features

  • Modern pyproject.toml with setuptools
  • Versioning based on git tag (only)
  • Easy development setup
  • Support for namespaces
  • Testing with coverage using pytest; tests may be in tests/, embedded in the package, and in doc strings
  • Examples for logging and package data
  • Command-line with argument parsing with argparse

DevOps

  • Quality tools: Code linting and reformatting with Ruff
  • GitHub Actions for testing and packaging

ToDo

  • Add devcontainer support

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

biocommons_example-0.0.5a1.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

biocommons.example-0.0.5a1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file biocommons_example-0.0.5a1.tar.gz.

File metadata

  • Download URL: biocommons_example-0.0.5a1.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for biocommons_example-0.0.5a1.tar.gz
Algorithm Hash digest
SHA256 4b4c8d06b8bfc69155488fc90e246b80eabd03ea8c36ae0a8fe90c6f29cd15dc
MD5 c87e48d5d1433d021fcc003d5d9d80e4
BLAKE2b-256 589e7313ff95311b6d6b5b698f46e0d6f944db8f50cc664805d6b0132af901c3

See more details on using hashes here.

File details

Details for the file biocommons.example-0.0.5a1-py3-none-any.whl.

File metadata

File hashes

Hashes for biocommons.example-0.0.5a1-py3-none-any.whl
Algorithm Hash digest
SHA256 dec038a1ddb63c3c603415334bba056eb2092b19c16a237e71be2d56a091d222
MD5 8c650fc252348a949b7431fc79619e22
BLAKE2b-256 121598ffa64b7a06d2d21266909577b154475fc20b68dfd3a3b2d669a863a759

See more details on using hashes here.

Supported by

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