A command line tool to setup Python packages
Project description
pyproject:
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
├── .git
├── .github
│ └── workflows
│ └── tests.yml
├── .gitignore
├── .pre-commit-config.yaml
├── LICENSE
├── README.md
├── benchmarks
│ └── benchmark.py
├── pyproject.toml
├── requirements_dev.txt
├── setup.cfg
├── src
│ └── myproject
│ ├── __init__.py
│ ├── __version__.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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyproject-generator-0.3.0.tar.gz
.
File metadata
- Download URL: pyproject-generator-0.3.0.tar.gz
- Upload date:
- Size: 52.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b230cccaf665c3fb104aad91b292a655376dc40d2d8c165fb932e64975686bd7 |
|
MD5 | fbcaa09679ddc7d1d69065825d41b053 |
|
BLAKE2b-256 | 14f88106442b3d7aa9556cff61017b7a6ca6ae2e3706f229ce44c903d77cb1ae |
File details
Details for the file pyproject_generator-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: pyproject_generator-0.3.0-py3-none-any.whl
- Upload date:
- Size: 61.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a61a161f8031ee60cda14db3c928ee25d28121f7ad246e64701d96c06f153c7 |
|
MD5 | 454c374a32c524ce806222ce52858544 |
|
BLAKE2b-256 | 5dabb1f6aa9e5e8bcd3bdd61f63813c7d374b7c6ae2734c3bb1aca2e7c438b74 |