Skip to main content

A command line tool to setup Python packages

Project description

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.

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

pyproject-generator-0.2.0.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

pyproject_generator-0.2.0-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file pyproject-generator-0.2.0.tar.gz.

File metadata

  • Download URL: pyproject-generator-0.2.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for pyproject-generator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e837635e13133a09d97efa34da2b11fa0f3222ffb03ff44b3ac093687f9f211e
MD5 2e9f7bf51bbb049314a31571aa757ac9
BLAKE2b-256 bc8a4bc43ee796ea96170fb2fd1dcf9330dc3c014e2b008a96934f7d7531587b

See more details on using hashes here.

File details

Details for the file pyproject_generator-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyproject_generator-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ce6d6410c4d498917222835da6ae3073266dffd9e63f20613eaf63bc0a05b3d
MD5 8fc5be0e2c6f9d73b2192fcb0199b361
BLAKE2b-256 9a4063a8a73169be5fbaeb90ca2a291c72311dcaeff0b3f7aa109acd93eb6076

See more details on using hashes here.

Supported by

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