Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,20 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Confirm that the `python` maps to the version we just installed.
# PowerShell on Windows does this differently than the Unix shells.
- run: which python ; python --version ; which pip ; pip --version
if: matrix.os != 'windows-latest'
- run: get-command python ; python --version ; get-command pip ; pip --version
if: matrix.os == 'windows-latest'
- uses: astral-sh/setup-uv@v5
- run: git --version
# Make sure Subversion and Mercurial are installed on Windows and macOS.
- run: sudo apt-get update && sudo apt-get install -y subversion mercurial
# Make sure Subversion (including `svnadmin`) and Mercurial are installed
# on Windows and macOS. I'd prefer `uv tool install mercurial`, but the
# `hg` binary that that installs crashes on Windows for some reason. We
# don't need Mercurial to use the same Python version that we're using.
# Also Choco and WinGet seem to fail to put `hg` in the PATH for some
# reason.
- run: pip install mercurial
- run: sudo apt-get update && sudo apt-get install -y subversion
if: matrix.os == 'ubuntu-latest'
- run: brew install subversion mercurial
- run: brew install subversion
if: matrix.os == 'macOS-latest'
- run: choco install -y --no-progress sliksvn && pip install mercurial
- run: choco install -y --no-progress sliksvn
if: matrix.os == 'windows-latest'
# Install test dependencies, like flake8.
- run: pip install -r ./requirements-dev.txt
# Run tests.
- run: python test.py -v
- run: uv run --python ${{ matrix.python-version }} test.py -v
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ __pycache__
peru.egg-info
build/
dist/
uv.lock
2 changes: 2 additions & 0 deletions peru.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# This script is for running peru directly from the repo, mainly for
# development. This isn't what gets installed when you install peru. That would
# be a script generated by setup.py, which calls peru.main.main().
#
# Update October 2025: `uv run peru` also works.

import os
import sys
Expand Down
40 changes: 40 additions & 0 deletions pyproject.toml
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW there are no uv-specific fields in this file, and other Python build frontends can understand it. All of the following work:

  • uv build
  • pip wheel .
  • python -m build
  • hatch build

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[project]
name = "peru"
dynamic = ["version"]
description = "A tool for fetching code"
readme = "README.md"
license = "MIT"
authors = [
{ name = "Jack O'Connor", email = "oconnor663@gmail.com" },
{ name = "Sean Olson", email = "olson.sean.k@gmail.com" },
]
requires-python = ">=3.8"
dependencies = [
"PyYAML",
]

[project.urls]
Repository = "https://github.com/buildinspace/peru"

[project.scripts]
peru = "peru.main:main"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build]
include = [
"peru/**/*.py",
"peru/VERSION",
"peru/resources/**/*",
]

[tool.hatch.version]
path = "peru/VERSION"
pattern = "(?P<version>.+)"

[dependency-groups]
dev = [
"flake8",
]
4 changes: 0 additions & 4 deletions requirements-dev.txt

This file was deleted.

59 changes: 0 additions & 59 deletions setup.py

This file was deleted.

Loading