Skip to content

Commit

Permalink
v0.0.3 (#8)
Browse files Browse the repository at this point in the history
* update versions

* migrate makefile to poethepoet

* minor pyproject.toml updates

* version/year bump

* read through docs and github actions

* system install

* system

* update github action os
  • Loading branch information
shapiromatron authored Jan 22, 2025
1 parent 317e71b commit 1838457
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 136 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/dev-enviro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@ jobs:
max-parallel: 4
matrix:
python-version: ["3.12"]
os: [ubuntu-22.04, windows-2022]
os: [ubuntu-24.04, windows-2025]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
python-version: '3.12'
architecture: 'x64'
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -e ".[dev]"
- name: Check all Makefile commands
uv pip install --system -e ".[dev]"
- name: Check commands
run: |
make clean
make lint
make format
make test
make coverage
make build
poe lint
poe format
poe test
poe coverage
poe build
25 changes: 14 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,37 @@ jobs:
max-parallel: 4
matrix:
python-version: ["3.12"]
os: ["ubuntu-22.04"]
os: ["ubuntu-24.04"]
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
python-version: '3.12'
architecture: 'x64'
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -e ".[dev]"
uv pip install --system -e ".[dev]"
- name: Check linting
run: |
make lint
poe lint
- name: Test with pytest
run: |
coverage run -m pytest
echo "# Python coverage report" >> $GITHUB_STEP_SUMMARY
coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
coverage report --format=markdown >> $GITHUB_STEP_SUMMARY || true
- name: Build a wheel
run: |
make build
poe build
- name: loc
run: |
sudo apt-get install -y cloc
echo "# Lines of code report" >> $GITHUB_STEP_SUMMARY
make loc >> $GITHUB_STEP_SUMMARY
poe loc >> $GITHUB_STEP_SUMMARY
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
Expand Down
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# History

## v0.0.3 (2025-01-21)

* Switched to [poethepoet](https://pypi.org/project/poethepoet/) for commands
* Updated packages to latest versions

## v0.0.2 (2024-05-25)

* Switched to use [uv](https://pypi.org/project/uv/) for development
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 pyscaffold maintainers
Copyright (c) 2025 pyscaffold maintainers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
46 changes: 0 additions & 46 deletions Makefile

This file was deleted.

18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Make sure you have python 3.12 available and on your path. Then:
python -m pip install -U pip

# if it's local file or a github link...
pip install path/to/pyscaffold-0.0.1-py3-none-any.whl
pip install path/to/pyscaffold-0.0.3-py3-none-any.whl
# if it's on pypi
pip install pyscaffold

Expand All @@ -39,29 +39,29 @@ pyscaffold bottles --num 20

## Developer setup

Make sure you have python 3.12 available and on your path. Then:
Make sure you have uv available on your path. Then:

```bash
# clone project
git clone [email protected]:shapiromatron/pyscaffold.git
cd pyscaffold

# create virtual environment and activate
python -m venv venv --prompt pyscaffold
uv venv --python=3.12 --prompt pyscaffold .venv
source venv/bin/activate # or venv\Scripts\activate on windows.

# install packages
python -m pip install -U pip uv
uv pip install -e ".[dev]"

# test local install
pyscaffold hello

# these should work on mac/linux/windows
make test # run tests
make lint # identify formatting errors
make format # fix formatting errors when possible
make build # build a python wheel
# run assorted commands
poe --help
poe test # run tests
poe lint # identify formatting errors
poe format # fix formatting errors when possible
poe build # build a python wheel
```

Github actions are setup to execute whenever code is pushed to check code formatting and successful tests. In addition, when code is pushed to the `main` branch, a wheel artifact is created and stored on github.
43 changes: 0 additions & 43 deletions make.bat

This file was deleted.

63 changes: 52 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[build-system]
requires = ["flit_core >=3.9,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "pyscaffold"
authors = [{name = "My pyscaffold", email = "[email protected]"}]
Expand All @@ -23,23 +19,28 @@ dependencies = [

[project.optional-dependencies]
dev = [
"flit~=3.9.0",
"coverage~=7.5.1",
"pytest~=8.2.1",
"ruff~=0.4.5",
"flit~=3.10.1",
"coverage~=7.6.10",
"pytest~=8.3.4",
"ruff~=0.9.2",
"poethepoet~=0.32.1",
]

[project.urls]
Home = "https://github.com/shapiromatron/pyscaffold"
Changes = "https://github.com/shapiromatron/pyscaffold/blob/main/HISTORY.md"
"Source Code" = "https://github.com/shapiromatron/pyscaffold"
"Changelog" = "https://github.com/shapiromatron/pyscaffold/blob/main/HISTORY.md"
"Issue Tracker" = "https://github.com/shapiromatron/pyscaffold/issues"

[project.scripts]
pyscaffold = "pyscaffold.cli:app"

[build-system]
requires = ["flit_core >=3.10,<4"]
build-backend = "flit_core.buildapi"

[tool.ruff]
line-length = 100
target-version = "py311"
target-version = "py312"

[tool.ruff.lint]
select = ["F", "E", "W", "I", "UP", "S", "B", "T20", "RUF"]
Expand All @@ -64,3 +65,43 @@ omit = [
[tool.coverage.report]
fail_under=99
precision=1

[tool.poe.tasks.lint]
help = "Check formatting issues"
sequence = [
{cmd = "ruff format . --check"},
{cmd = "ruff check ."},
]

[tool.poe.tasks.format]
help = "Fix formatting issues (where possible)"
sequence = [
{cmd = "ruff format ."},
{cmd = "ruff check . --fix --show-fixes"},
]

[tool.poe.tasks.test]
help = "Run tests"
cmd = "pytest"

[tool.poe.tasks.coverage]
help = "Generate test coverage report"
sequence = [
{cmd = "coverage run -m pytest"},
{cmd = "coverage html"},
]

[tool.poe.tasks.loc]
help = "Lines of Code Report"
cmd = """
cloc
--exclude-dir=venv,build,dist
--exclude-ext=json,yaml,svg,toml,ini
--vcs=git \
--md \
.
"""

[tool.poe.tasks.build]
help = "Build wheel package"
cmd = "uv build"
2 changes: 1 addition & 1 deletion src/pyscaffold/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""The pyscaffold project is your entrypoint into simple python packages"""

__version__ = "0.0.2"
__version__ = "0.0.3"

0 comments on commit 1838457

Please sign in to comment.