Shared development tools for Python projects - character validation, circular import detection, and more
Project description
apdev (Python)
Shared development tools for Python projects.
Installation
pip install apdev
For development:
pip install apdev[dev]
Tools
check-chars
Validate that files contain only allowed characters (ASCII, common emoji, and technical symbols like arrows and box-drawing characters).
# Check specific files
apdev check-chars src/mypackage/*.py
# Use with pre-commit (see below)
check-imports
Detect circular imports in a Python package.
# Specify package explicitly
apdev check-imports --package mypackage --src-dir src
# Or configure in pyproject.toml (see below)
apdev check-imports
release
Interactive release automation for publishing Python packages to PyPI and GitHub. Auto-detects project name from pyproject.toml and GitHub repo from git remote.
# Run with auto-detected version from pyproject.toml
apdev release
# Or specify version explicitly
apdev release 0.2.0
The command provides an interactive menu with steps:
- Version verification (checks
pyproject.tomland__init__.pymatch) - Status check (tag, build files, PyPI)
- Clean build files
- Build package (
python -m build) - Check package (
twine check) - Create git tag and push
- Create GitHub release (via
ghCLI or API) - Upload to PyPI (
twine upload)
Override auto-detection with environment variables:
PROJECT_NAME=mypackage GITHUB_REPO=owner/repo apdev release
Configuration
Add to your project's pyproject.toml:
[tool.apdev]
base_package = "mypackage"
src_dir = "src"
Pre-commit Integration
repos:
- repo: https://github.com/aipartnerup/apdev
rev: python/v0.1.0
hooks:
- id: check-chars
- id: check-imports
Or use as a local hook with the pip-installed package:
repos:
- repo: local
hooks:
- id: check-chars
name: apdev check-chars
entry: apdev check-chars
language: system
types_or: [text, python]
- id: check-imports
name: apdev check-imports
entry: apdev check-imports
language: system
pass_filenames: false
always_run: true
License
Apache-2.0
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
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 apdev-0.2.0.tar.gz.
File metadata
- Download URL: apdev-0.2.0.tar.gz
- Upload date:
- Size: 22.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0748f0429b6ade5522730823a3c22e32e8a008c8be4bbc3a8bb4e80302d25ad
|
|
| MD5 |
d1d9de8f45e3d3be177752abf0e884bf
|
|
| BLAKE2b-256 |
c3c95f163ec7ed157e1f038257f630550c405f9269be71c9f7ee84f35ee0357c
|
File details
Details for the file apdev-0.2.0-py3-none-any.whl.
File metadata
- Download URL: apdev-0.2.0-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f40c44e9b7c370fec887d14538fde63b4b20005220a9b7f3ab2cb3cadd5c6a5
|
|
| MD5 |
7892a64d66f9e95d7c597d80452793d3
|
|
| BLAKE2b-256 |
d141210d3b6e32bfce9f1d53d65b20adff8ab076d662cab465476d4773968c11
|