Skip to content

Developer Environment

Shreyas V edited this page Dec 1, 2025 · 8 revisions

Requirements

  • Python ≥ 3.9
  • uv (dependency manager)
  • git (Obviously)

Install uv if missing:

curl -LsSf https://astral.sh/uv/install.sh | sh

Setup (Local development)

  1. Fork the repository
  2. Clone it
  3. Sync dependencies (creates .venv automatically)
uv sync
  1. Activate venv
source .venv/bin/activate 

You’re ready to develop.

Run Tests

pytest -v

(Add more tests gradually, don’t wait till the end.)

Docstrings

Use Google or reST style. Example:

def backup_files():
    """
    Copies files listed in config.ini into the backup directory.

    Returns:
        bool: True if backup completed, False if skipped.
    """

Pre-commit (Formatting)

pre-commit install
pre-commit run --all-files

Configured tools:

  • black → formatting

Development Tips

Run latest code instantly:

pip install --editable .

Check which version is used:

which dotpush

Filing Issues / PRs

When contributing:

  • Create a branch: feature/
  • Write clear commit messages
  • Add tests for new features
  • Format code before submitting

Warning

makepkg -si will fail inside virtual environment.
Reason: When inside .venv, makepkg accidentally uses that Python instead of system /usr/bin/python, which breaks the build (build / installer / setuptools might be missing).
Always use makepkg -si OUTSIDE your virtual environment.

Publishing a new version (For code-owner)

  1. Update Version:
  • PKGBUILD: pkgver
  • pyproject.toml: version
  • setup.py: version
  1. Commit Version bump:
git add pyproject.toml
git commit -m "Bump version to v1.1.1"
  1. Build Python package:

Make sure you're NOT in venv:

deactivate 2>/dev/null || true

Build:

/usr/bin/python -m build

You'll get:

dist/dotpush-<ver>.tar.gz <--- Release version
dist/dotpush-<ver>-py3-none-any.whl
  1. Generate SHA256 for AUR
sha256sum dist/dotpush-<ver>.tar.gz
  1. Update PKGBUILD:
sha256sums=('PASTE_YOUR_HASH_HERE')
  1. Draft New Release on GitHub and Upload dist/dotpush-<ver>.tar.gz & dist/dotpush-<ver>-py3-none-any.whl

  2. Test Release locally:

makepkg -si
  1. AUR Release:

Update the version in /aur/dotpush fork: .SRCINFO and PKGBUILD and Push

Verify:

yay -S dotpush

Clone this wiki locally