Skip to main content

A pypi release of the MDAT

Project description

poetry_pypi_template

A minimal template for creating a pypi package using poetry and github actions

This template allows the creation of python projects managed by poetry to be submitted to PyPi. All the github actions have been setup too. The github actions run tests on every push and also creates and new pacakage and pushes to the pypi when a merge happens to the release branch.

Just follow the seteps below for an hassle free setup of the project.

Create from the Project Template

  • Click here to create a new repo (you need to be logged in to GitHub for this link to work), and follow the instructions to create a new repo from this template.
  • git clone your new repo

Install Poetry in your Environment

  • activate your environment.
  • install poetry python -m pip install poetry

Update the Project Toml

  • Insert/Update the values in the pyproject.toml under tool.poetry
  • Dont forget to update the desired python version under the tool.poetry.dependencies
  • Dont forget to modify the release branch under tool.semantic_release (assumption is main is the release branch)
  • add project dependancies. eg - if you want numpy as an dependancy simply run poetry add numpy
  • install the dependancies by running poetry install
  • More information on setting up a project with poetry

Write Code for your python package

  • Create a project folder. eg. hapi_pypi here
  • add all the code/implemenations in the folder.

Implement the Tests

  • Check the functionality of the project folder by implementing tests.
  • Implement tests in the tests folder.
  • All the tests should pass when you run the command poetry run pytest tests/
  • Details on how to implement tests with pytest.

Github Actions Configuration

  • all the github actions are defined in the .github/workflows folder
  • setup the test.yml. Update the env variables according to the project setup before. The default coverage limit is set to 90% ie the test will fail below the coverage of 90.
env:
  PYTHON_VERSION: "3.8.5"
  PROJECT_FOLDER: hapy_pypi
  TEST_FOLDER: tests
  COVERAGE_LIMIT: 90
  • setup the similar env variables in release.yml as well.

Setup Secrets

Pypi Creds

These secrets are used to push releases to the pypi repository.

  • Generate a pypi api token
  • Set Repo Secrets
  • Add PYPI_USER as __token__
  • Add PYPI_TOKEN as the token from above step including the pypi- prefix

Github Token

This secret is required to generate the CHANGELOG.MD and update the version by SemRel.

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

mdatpy-0.0.4.tar.gz (133.8 kB view details)

Uploaded Source

Built Distribution

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

mdatpy-0.0.4-py3-none-any.whl (191.8 kB view details)

Uploaded Python 3

File details

Details for the file mdatpy-0.0.4.tar.gz.

File metadata

  • Download URL: mdatpy-0.0.4.tar.gz
  • Upload date:
  • Size: 133.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.6 Linux/5.15.0-48-generic

File hashes

Hashes for mdatpy-0.0.4.tar.gz
Algorithm Hash digest
SHA256 8d18a2fc74b45db4b9a63b6a6d290c8bb1a02cc218acf29dcbb1f561093519d9
MD5 8e45c323ba182be23e2fdeb702b99ddb
BLAKE2b-256 21e272451faa0315d09a5b5027ca47078dbffbeadc798ad9e2931fc12d30921c

See more details on using hashes here.

File details

Details for the file mdatpy-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: mdatpy-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 191.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.6 Linux/5.15.0-48-generic

File hashes

Hashes for mdatpy-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3abd2f058f3d9b7790db79ca76e28d95231ac2ebde6ca1eac089e17edbea964e
MD5 54078b7ecb2b6d57c8685b63a8de696b
BLAKE2b-256 b450bb42029038e51f9703f8c3aff6dabafd98dedb5e9c6e1a1d3d3ff6a360ef

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