Skip to main content

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:

  1. Version verification (checks pyproject.toml and __init__.py match)
  2. Status check (tag, build files, PyPI)
  3. Clean build files
  4. Build package (python -m build)
  5. Check package (twine check)
  6. Create git tag and push
  7. Create GitHub release (via gh CLI or API)
  8. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apdev-0.1.1.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apdev-0.1.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file apdev-0.1.1.tar.gz.

File metadata

  • Download URL: apdev-0.1.1.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for apdev-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e9e7792890a49c8af4e1fecbe998aa4979c06f1cb4952f55e28d20fb07061e16
MD5 8526e0231de2e0a03e162522ab1ea4e1
BLAKE2b-256 e77f9208b0729b90d72f9d1db71e29960be934542ff11256035ea9c7a2ac7261

See more details on using hashes here.

File details

Details for the file apdev-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: apdev-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for apdev-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 076d1c1b1a83c0211c2a242c143d541eb6dba4408cad907b7c998096d8d6a984
MD5 1d555d119a2b1902be767bcf4615a260
BLAKE2b-256 3f0d4f2477ed79815794d8d841835ccfaac709919c7dad560a21b7c198a80b95

See more details on using hashes here.

Supported by

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