Skip to main content

pyproject:

PyPI version PyPI - Downloads License: MIT pre-commit Checked with mypy Code style: black Imports: isort

What is it?

pyproject is a command line utility to setup and distribute Python packages.

Usage:

Dependencies

  • platformdirs - Install configuration files in the correct location
  • rich - Beautiful terminal output

Installing

The easiest way is to install pyproject is from PyPI using pip:

pip install pyproject-generator

Afterwards, a pyproject command will be exposed on your system.

Initializing a Project

Simply run

pyproject init {project_name}

to create your project folder. It will automatically setup a package structure, virtual environment, and install packages.

The final project structure looks like

├── .github
│   └── workflows
│       └── tests.yml
├── .gitignore
├── LICENSE
├── README.md
├── benchmarks
│   └── benchmark.py
├── pyproject.toml
├── requirements_dev.txt
├── setup.cfg
├── src
│   └── myproject
│       ├── __init__.py
│       └── py.typed
├── tests
│   └── test_myproject.py
└── tox.ini

Configuring pyproject-generator

pyproject also allows you to configure your author name, email, Github URL, PyPI username and password, and a list of default dependencies that you want to install. Please note that your credentials are simply stored locally as plaintext. If you do not wish to store them, you can simply pass them in manually via the --pypi_username and --pypi_password flags, or run without any flags and type them in as required. To configure, run

pyproject config --author="" --email="" --github_url="" --pypi_username="" --pypi_password=""

You may set dependencies one of three ways. In all cases, pass in a comma-delimited string (for multiple dependencies) or a string (for one dependency). You can set the dependencies, which overrides the default settings.

pyproject config --set_dependencies="white,ruff,mypy"

You may add dependencies:

pyproject config --add_dependencies="django"

And you may remove dependencies:

pyproject config --remove_dependencies="pre-commit"

Note that these flags also work with the init action. config merely does the work of saving them locally to be re-used later.

Uploading a Project

pyproject also supplies an upload function. Run

pyproject upload

to build and upload your package to PyPI.

Metadata

Release files for pyproject-generator 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyproject-generator 0.2.0
File Size Uploaded
pyproject-generator-0.2.0.tar.gz 16.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyproject-generator 0.2.0
File Interpreter ABI Platform
pyproject_generator-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.8 kB

Release files / pyproject-generator-0.2.0.tar.gz

Download URL pyproject-generator-0.2.0.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e837635e13133a09d97efa34da2b11fa0f3222ffb03ff44b3ac093687f9f211e
BLAKE2b-256 checksum
How to use checksums
bc8a4bc43ee796ea96170fb2fd1dcf9330dc3c014e2b008a96934f7d7531587b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / pyproject_generator-0.2.0-py3-none-any.whl

Download URL pyproject_generator-0.2.0-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ce6d6410c4d498917222835da6ae3073266dffd9e63f20613eaf63bc0a05b3d
BLAKE2b-256 checksum
How to use checksums
9a4063a8a73169be5fbaeb90ca2a291c72311dcaeff0b3f7aa109acd93eb6076
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page