A universal tool to automate Python project installation, testing, building, PyPI upload, version incrementing, and Git push with dependency conflict detection.
Project description
OceanCrow_AutoPublish
A universal Python tool to automate installing, testing, building, uploading to PyPI, version incrementing, and pushing to a Git repository, with dependency conflict detection.
Features
- Installs your project (
pip install .orpip install -e .). - Runs tests (
pytest,nose,unittest, or custom commands). - Builds the package (
build,poetry,flit, orhatch). - Uploads to PyPI or TestPyPI with
twine. - Increments version (major, minor, or patch) in
pyproject.tomlorsetup.py. - Commits and pushes to a Git repository.
- Cleans
dist/,build/, and*.egg-info/directories. - Securely manages PyPI credentials with
keyring. - Supports interactive mode for guided configuration.
- Verbose logging for detailed debugging.
- Detects dependency conflicts using
pipdeptree. - Configuration via
.autopublish.toml.
Installation
pip install OceanCrow_AutoPublish
Prerequisites
A Python project with pyproject.toml or setup.py.
Required dependencies: toml, gitpython, tqdm, keyring, prompt_toolkit, pipdeptree.
Optional dependencies: build, twine, pytest, poetry, flit, nose, hatch.
PyPI credentials (stored in keyring, ~/.pypirc, or environment variables).
A Git repository with a remote (origin).
Usage
cd your-python-project
OceanCrow_AutoPublish
Options:
--skip-tests: Skip running tests.
--dry-run: Simulate the process without executing commands.
--pypi-repo <repo>: Specify PyPI repository (e.g., pypi, testpypi).
--clean: Remove dist/, build/, and *.egg-info/ directories.
--version-type <type>: Version increment type (major, minor, patch).
--verbose: Enable detailed logging.
--interactive: Run in interactive mode with guided prompts.
Configuration
Create a .autopublish.toml in your project directory:
[autopublish]
install_type = "editable" # or "regular"
commit_message = "Release v1.0.0"
max_retries = 3
build_tool = "hatch" # or "build", "poetry", "flit"
test_tool = "pytest" # or "nose", "unittest"
test_command = "tox -e py39" # optional
version_type = "minor" # or "major", "patch"
check_dependencies = true # enable/disable dependency conflict check
Interactive Mode
OceanCrow_AutoPublish --interactive
Guides you through configuration with autocompletion and defaults, including dependency conflict checking.
Example
OceanCrow_AutoPublish --interactive --clean --pypi-repo testpypi --version-type minor --verbose
Dependency Conflict Detection
Checks for dependency conflicts using pipdeptree.
Warns if conflicts are detected, with an option to continue or abort.
Recommends running in a fresh virtual environment if conflicts are found.
Use --verbose to see the full dependency tree.
Credential Management
PyPI credentials are stored securely in keyring. On first use, you’ll be prompted to enter and optionally store your username and token.
Logs
Check OceanCrow_AutoPublish.log for detailed output. Use --verbose for more details.
CI/CD
See CONTRIBUTING.md for a GitHub Actions workflow to automate testing and PyPI publishing.
Contributing
See CONTRIBUTING.md for guidelines.
License
MIT License. See LICENSE for details.
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oceancrow_autopublish-0.6.0-py3-none-any.whl.
File metadata
- Download URL: oceancrow_autopublish-0.6.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
def22a26d7141847345aca9b19990b801c5e6e74e6ccb45268efa7919961c710
|
|
| MD5 |
e86fa3bbe2f2a9bf0d8afb2f9dcbd25a
|
|
| BLAKE2b-256 |
4bd538f21813d4b9ff14a44219deb3625ee245b688b008ea33dd73d9fa3def72
|