rye-easy
Rye Easy is a tool to help you manage your Python projects with Rye.
Installation
pip install rye-easy
Usage
Rye Easy provides simple commands to build and publish your Python packages managed with Rye.
Command Line Interface
Build Command
python -m rye_easy build
When you run the build command, the following operations are performed:
- Cleans the
distdirectory to remove any previous build artifacts - Bumps the patch version of your package using
rye version --bump patch - Builds the package using
rye build - Installs the newly built wheel package locally using pip
This is useful for testing your package locally before publishing.
Publish Command
python -m rye_easy publish
When you run the publish command, the following operations are performed:
- Bumps the patch version of your package using
rye version --bump patch - Adds the updated
pyproject.tomlto git staging - Commits the changes with the message "update version"
- Creates a git tag with the new version (prefixed with 'v')
- Pushes the commit to the remote repository
- Pushes the tags to the remote repository
This command automates the entire release process in one step.
Update Pyproject Command
# Read the entire pyproject.toml
python -m rye_easy update_pyproject
# Read a specific value
python -m rye_easy update_pyproject --section project --key version
# Update a specific value
python -m rye_easy update_pyproject --section project --key description --value "New description"
The update_pyproject command allows you to read or modify values in your pyproject.toml file:
- Without arguments, it returns the entire pyproject.toml content
- With
--sectionand--key, it reads a specific value - With
--section,--key, and--value, it updates a specific value
The section parameter supports nested sections using dot notation (e.g., "tool.rye").
Fix Build System Command
# Use the default hatchling version (1.26.3)
python -m rye_easy fix_buildsystem
# Specify a different hatchling version
python -m rye_easy fix_buildsystem --version 1.27.0
The fix_buildsystem command updates the build-system requirements in your pyproject.toml file:
- Removes any existing hatchling entries from the requires list
- Adds the specified hatchling version (default is 1.26.3)
- Ensures the build-backend is set to "hatchling.build"
This is useful for fixing build issues related to the hatchling version.
Add Script Command
# Add a script entry
python -m rye_easy add_script --name my_script --target "my_package.module:function"
The add_script command adds or updates a script entry in the [project.scripts] section of your pyproject.toml file:
--name: Name of the script to add--target: Target module or function for the script
For example, the command above would add the following entry to your pyproject.toml:
[project.scripts]
my_script = "my_package.module:function"
As a Python Module
from rye_easy import build, publish, update_pyproject, fix_buildsystem, add_script
# Build your package
build()
# Publish your package
publish()
# Read or update pyproject.toml
data = update_pyproject() # Read entire file
version = update_pyproject(key="version", section="project") # Read a value
update_pyproject(key="description", value="New description", section="project") # Update a value
# Fix build system
fix_buildsystem() # Use default hatchling version (1.26.3)
fix_buildsystem(hatchling_version="1.27.0") # Specify a version
# Add a script entry
add_script(script_name="my_script", script_target="my_package.module:function")
Functions
build(): Bumps patch version, builds the package, and installs it locallypublish(): Bumps patch version, commits changes, creates a git tag, and pushes to remoteclean_dist(): Cleans the dist directoryget_version(): Gets the current version from Ryeupdate_pyproject(key=None, value=None, section=None): Reads or updates values in pyproject.tomlfix_buildsystem(hatchling_version="1.26.3"): Updates build-system requirements in pyproject.tomladd_script(script_name, script_target): Adds a script entry to the [project.scripts] section
TODO
- pyproject.toml hatching 버젼 수정하여 build 잘 되게 하기
- github action 에서 배포가 잘될 수 있게 .github\workflows\python-publish.yml을 복사할 수 있게 하기
Metadata
Release files for rye-easy 0.1.29
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rye_easy-0.1.29.tar.gz | 5.7 kB | Without provenance | Details for rye_easy-0.1.29.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rye_easy-0.1.29-py3-none-any.whl | Python 3 | none | any | Details for rye_easy-0.1.29-py3-none-any.whl |
Total release size: 10.6 kB
Release files / rye_easy-0.1.29.tar.gz
| Download URL | rye_easy-0.1.29.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09c6b631accf766cd278dc70c4f1b0608dc2b41ea5dc592633b9b2f0d7aac588
|
|
BLAKE2b-256 checksum How to use checksums |
fc0f38f1e0ead24ea3e97f836dbef9b120611f2fba6c39653d5085923761706d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.9
|
Release files / rye_easy-0.1.29-py3-none-any.whl
| Download URL | rye_easy-0.1.29-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc00560a85828c8777c8e84b1be04181c0a5dd3f39403adb9dc18a277d7ec267
|
|
BLAKE2b-256 checksum How to use checksums |
b0398bd6b919677e6e95c1b0b64c9f29bc161196db5a127863c5dc8f9b4f8d4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.9
|
Security for rye-easy 0.1.29
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.