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

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.2.2.tar.gz (10.9 kB view hashes)

Uploaded Source

Built Distribution

mkpyp-0.2.2-py3-none-any.whl (13.2 kB view hashes)

Uploaded Python 3

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