Skip to main content

Build utilities for pykit3 packages

Project description

pykit3

Collection of Python 3 utility modules.

Module Description
k3color Terminal text coloring
k3confloader Configuration loader
k3dict Dictionary operations
k3down2 Markdown to media converter
k3fmt String formatting utilities
k3fs File system utilities
k3git Git command wrapper
k3handy Common function aliases
k3heap Binary min heap
k3jobq Concurrent job processor
k3log Logging utilities
k3math Math implementations
k3net Network utilities
k3num Human-readable numbers
k3pattern Pattern matching
k3portlock TCP port-based locks
k3priorityqueue Priority queue
k3proc Process utilities
k3rangeset Range operations
k3shell Shell command management
k3str String utilities
k3thread Thread utilities
k3time Time conversion
k3txutil Transaction helpers
k3ut Unit test utilities

This repository manages the pykit3 module collection.

Development

Engineering Principles

  • Clarity first: Write code for humans, prioritize readability
  • Correctness over performance: Focus on getting it right first
  • Simplicity: Throw away what can't be done in a day, rewrite simpler tomorrow
  • No smart code: Write straightforward, maintainable code
  • Comment WHY, not HOW: Let code explain itself

Workflow

  1. Fork repository
  2. Create feature branch
  3. Implement changes
  4. Open pull request with rebase to main

Module Development

Setup

  • CI: GitHub Actions (.github/workflows/python-package.yml)
  • Testing: pytest framework
  • Documentation: Sphinx with Google docstring style
  • Build docs: make doc

Module Structure

  • __init__.py must define __name__ and __version__ (semantic versioning)
  • GitHub metadata managed via .github/settings.yml

Publishing

  1. Update __version__ in __init__.py
  2. Commit and run make build_setup_py
  3. Push tag to trigger PyPI upload via GitHub Actions

Directory Structure

k3module/
├── .github/workflows/    # CI/CD configurations
├── _building/           # Build utilities  
├── docs/               # Sphinx documentation
├── test/               # Unit tests
├── __init__.py        # Module metadata and exports
├── main_module.py     # Primary implementation
├── LICENSE
├── Makefile          # Build commands
├── README.md         # Auto-generated, do not edit
├── requirements.txt  # Dependencies
└── setup.py         # Auto-generated for releases

Key files:

  • docs/source/index.rst: Update for new APIs
  • README.md: Generated via make readme
  • setup.py: Generated via make build_setup_py

Creating New Modules

  1. Fork from tmpl (template repository)
  2. Choose name starting with k3
  3. Clone: git clone git@github.com:pykit3/k3newmodule.git
  4. Generate skeleton: python ./_building/populate.py

Template Updates

  • Populate it: python ./_building/populate.py. This step generates a skeleton of a module:

    python ./_building/populate.py
    git status
    ...
        new file:   .github/settings.yml
        new file:   __init__.py
        new file:   docs/source/index.rst
        new file:   package.json
        new file:   packages.txt
        new file:   requirements.txt
        new file:   test-requirements.txt
        new file:   test/test_doctest.py
        new file:   test/test_k3whatever.py
    

    Examine the generated files and add them and make your first commit!

Update tmpl changes

applytmpl.sh copies changes from repo tmpl to current dir. It should be run in a repo dir, e.g., k3zkutil:

./tmpl
./k3zkutil

To apply tmlp chagnes to every repo:

run-script-in-repos.sh repo-apply-tmpl.sh

Documentation & Testing

  • Document all modules, classes, and methods
  • Write comprehensive tests

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

pk3-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

pk3-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file pk3-0.1.0.tar.gz.

File metadata

  • Download URL: pk3-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for pk3-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e63ae45fc288eae660d1d2d5a9d3b1db4eb6bd19d2137c3dc985dc9385e3e45
MD5 11ba02b97c3c33471462240f4054f976
BLAKE2b-256 7d7898540dd739d8d2d9b88b0b075d6bdac90458da351d9113c81b971ef0c544

See more details on using hashes here.

File details

Details for the file pk3-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pk3-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for pk3-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 defb0996a73d88f11035099f5cac81f5982bfdbd18f7547f2d649fe0e547856f
MD5 7b75796c570ad6403f89b126d0184947
BLAKE2b-256 4c16817850eace1647b1cfc872b5158c052d47e1b793d376e216a9f3d9f4021b

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