Skip to main content

make python projects idiomatically

Project description

mkpyp

make python projects idiomatically

Generates a new idiomatic Python project for linux/macos:
project structure - .gitignore, LICENSE
format - black, isort
lint - ruff, mypy, black
test - pytest, coverage
other - pre-commit, Makefile, version.py, requirements

Installation

Install with pip3 install mkpyp. Run with mkpyp.

Developer Installation

After cloning this repo or initializing a new git repository with git init, complete the following steps in root directory.

# create a new virtual environment (e. g. venv)
python3 -m venv .venv

# activate the virtual environment
source .venv/bin/activate

# install pip-compile for auto-generating requirement files
pip install pip-tools hatch

# generate requirement files
make refresh-requirements

# install the requirements and install 'mkpyp' as editable package
make install

# autorun pre commit, needs .git directoy | manually run with pre-commit
pre-commit install

Dependency Management

The location of where dependencies are declared depends on their scope.

  • Package dependencies must be put into pyproject.toml [project] .dependencies.
  • Opt-in dependencies must be put into pyproject.toml [project] .optional-dependencies.
  • Testing dependencies must be put into requirements/testing.in.
  • Linting dependencies must be put into requirements/linting.in.

We generate the requirements files with make refresh-requirements. Reinstall with make install.

Publish

Build the project with hatch build. Now run hatch publish --repo test to upload the package to test.pypi.org. Use hatch publish --repo main to upload to the production PyPI. Define custom targets as per defined here.

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

mkpyp-0.3.2.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

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

mkpyp-0.3.2-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file mkpyp-0.3.2.tar.gz.

File metadata

  • Download URL: mkpyp-0.3.2.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.3

File hashes

Hashes for mkpyp-0.3.2.tar.gz
Algorithm Hash digest
SHA256 272fb31819afb01f295dfead505db94019a8318a22b9d1a8d21d321adfa03a9b
MD5 7690bae22e9983558664e71f75aaeeec
BLAKE2b-256 ff56a6dd977b932ef1f8c7578811ae1ec35b02243b4bb22e3c8c13e2692f6fff

See more details on using hashes here.

File details

Details for the file mkpyp-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: mkpyp-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.3

File hashes

Hashes for mkpyp-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b846b50472bce4039d12d73ce0fedfbfc1d282f279077d0b2595c61adcf144f7
MD5 96232fe0facf2b849a72deb3f365914d
BLAKE2b-256 13b57e87b8c6bbd06c6d45e2cdd820da26bfb079a37b02868f98401bc0cbf77f

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