Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/is-version-number-acceptable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ then
exit 0
fi

current_version=`python setup.py --version`
current_version=`python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])"`

if git rev-parse --verify --quiet $current_version
then
echo "Version $current_version already exists in commit:"
git --no-pager log -1 $current_version
echo
echo "Update the version number in setup.py before merging this branch into master."
echo "Update the version number in pyproject.toml before merging this branch into master."
echo "Look at the CONTRIBUTING.md file to learn how the version number should be updated."
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/publish-git-tag.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/env bash

git tag `python setup.py --version`
git tag `python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])"`
git push --tags || true # update the repository version
20 changes: 11 additions & 9 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check formatting
uses: "lgeiger/black-action@master"
with:
Expand All @@ -15,17 +15,19 @@ jobs:
name: Check version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Build changelog
run: pip install yaml-changelog==0.3.0 && make changelog
run: uv tool install yaml-changelog==0.3.0 && make changelog
- name: Preview changelog update
run: ".github/get-changelog-diff.sh"
- name: Check version number has been properly updated
Expand All @@ -37,18 +39,18 @@ jobs:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install build dependencies
run: pip install wheel setuptools
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install package
run: make install
- name: Run tests
run: make test
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
- name: Build package
run: make build
- name: Test documentation builds
Expand Down
40 changes: 22 additions & 18 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
(github.repository == 'PolicyEngine/policyengine-canada')
&& (github.event.head_commit.message == 'Update PolicyEngine Canada')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check formatting
uses: "lgeiger/black-action@master"
with:
Expand All @@ -22,17 +22,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.POLICYENGINE_GITHUB }}
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Build changelog
run: pip install yaml-changelog==0.3.0 && make changelog
run: uv tool install yaml-changelog==0.3.0 && make changelog
- name: Preview changelog update
run: ".github/get-changelog-diff.sh"
- name: Update changelog
Expand All @@ -52,16 +54,18 @@ jobs:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install package
run: make install
- name: Run tests
run: make test
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
- name: Generate documentation
run: make documentation
- name: Deploy documentation
Expand All @@ -78,15 +82,15 @@ jobs:
&& (github.event.head_commit.message == 'Update PolicyEngine Canada')
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Publish a git tag
run: ".github/publish-git-tag.sh || true"
- name: Install build dependencies
run: pip install wheel setuptools
- name: Install package
run: make install
- name: Build package
Expand All @@ -106,20 +110,20 @@ jobs:
GH_TOKEN: ${{ secrets.POLICYENGINE_GITHUB }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.POLICYENGINE_GITHUB }}
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install Wheel and Pytest
run: pip3 install wheel setuptools pytest==5.4.3
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install package
run: make install
- name: Update API
run: python .github/update_api.py
run: uv run python .github/update_api.py
env:
GITHUB_TOKEN: ${{ secrets.POLICYENGINE_GITHUB }}
GITHUB_TOKEN: ${{ secrets.POLICYENGINE_GITHUB }}
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
all: install format test build changelog

documentation:
python -m jupyter_book clean docs
python -m jupyter_book build docs
uv run python -m jupyter_book clean docs
uv run python -m jupyter_book build docs

format:
black . -l 79
linecheck . --fix
uv run black . -l 79
uv run linecheck . --fix

install:
pip install -e .[dev]
uv sync

test:
policyengine-core test -c policyengine_canada policyengine_canada/tests
uv run policyengine-core test -c policyengine_canada policyengine_canada/tests

build:
python setup.py sdist bdist_wheel
uv build

changelog:
build-changelog changelog.yaml --output changelog.yaml --update-last-date --start-from 0.0.0 --append-file changelog_entry.yaml
build-changelog changelog.yaml --org PolicyEngine --repo policyengine-canada --output CHANGELOG.md --template .github/changelog_template.md
bump-version changelog.yaml setup.py
uv run build-changelog changelog.yaml --output changelog.yaml --update-last-date --start-from 0.0.0 --append-file changelog_entry.yaml
uv run build-changelog changelog.yaml --org PolicyEngine --repo policyengine-canada --output CHANGELOG.md --template .github/changelog_template.md
uv run bump-version changelog.yaml pyproject.toml
rm changelog_entry.yaml || true
touch changelog_entry.yaml
touch changelog_entry.yaml
70 changes: 70 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "policyengine-canada"
version = "0.96.6"
description = "Microsimulation model for Canada's tax-benefit system."
readme = "README.md"
license = "AGPL-3.0-or-later"
keywords = ["tax", "benefit", "microsimulation", "framework"]
authors = [
{ name = "PolicyEngine", email = "hello@policyengine.org" }
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Information Analysis",
]
requires-python = ">=3.10"
dependencies = [
"policyengine_core>=3.23.6",
"black[jupyter]",
"coverage<7",
"dpath<3",
"h5py>=3,<4",
"linecheck<1",
"microdf_python>=1.2.1",
"nptyping<2",
"numexpr<3",
"pandas>=2.2.0",
"plotly>=5.6.0,<6",
"pytest",
"requests>=2.27.1,<3",
"sortedcontainers<3",
"tqdm>=4.46.0,<5",
"wheel<1",
"yaml-changelog==0.3.0",
]

[project.optional-dependencies]
dev = [
"furo",
"jupyter-book",
"markupsafe",
"pydata-sphinx-theme",
"sphinx",
"sphinx-argparse",
"sphinx-math-dollar",
]

[project.urls]
Homepage = "https://github.com/policyengine/policyengine-canada"
Repository = "https://github.com/policyengine/policyengine-canada"

[tool.hatch.build.targets.wheel]
packages = ["policyengine_canada"]

[tool.hatch.build.targets.sdist]
include = [
"/policyengine_canada",
"/README.md",
"/LICENSE",
]
70 changes: 0 additions & 70 deletions setup.py

This file was deleted.

Loading
Loading