Skip to content

Commit 5d69674

Browse files
committed
Migrate from uv to Poetry for dependency management
Replaced uv with Poetry for dependency management and updated related documentation, Makefile targets, and CI workflows. Added poetry.lock, removed MANIFEST.in and constraints.txt, and updated .gitignore. Enhanced Dependabot and GitHub Actions to support Poetry. Updated CHANGELOG and README to reflect the new build and install process.
1 parent 29fd999 commit 5d69674

File tree

15 files changed

+845
-631
lines changed

15 files changed

+845
-631
lines changed

.codecov.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@ coverage:
1010
comment:
1111
layout: "header, diff"
1212
behavior: default
13-
ignore:
14-
- "**/file_io.py"
15-
- "**/selector.py"

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,16 @@ updates:
2222
time: "09:00"
2323
timezone: Australia/Melbourne
2424
open-pull-requests-limit: 1
25+
26+
- package-ecosystem: poetry
27+
directory: "/"
28+
groups:
29+
all-dependencies:
30+
patterns:
31+
- "*"
32+
schedule:
33+
interval: weekly
34+
time: "09:30"
35+
timezone: Australia/Melbourne
36+
open-pull-requests-limit: 1
37+

.github/workflows/build-and-test.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
runs-on: ubuntu-latest
2929
strategy:
3030
matrix:
31-
python-version: [3.13, 3.12, 3.11]
31+
python-version: ["3.11", "3.12", "3.13"]
3232

3333
steps:
3434
- name: Checkout source
@@ -42,6 +42,15 @@ jobs:
4242
- name: Install dependencies
4343
run: make install-test-deps
4444

45-
- name: Run tests with Makefile
46-
run: |
47-
make test-coverage
45+
- name: Run tests with coverage
46+
run: make test-coverage
47+
48+
- name: Upload coverage to Codecov
49+
if: matrix.python-version == '3.13'
50+
uses: codecov/codecov-action@v5
51+
with:
52+
file: ./coverage.xml
53+
flags: unittests
54+
name: codecov-umbrella
55+
fail_ci_if_error: false
56+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,13 @@ jobs:
1313

1414
steps:
1515
- name: Checkout repository
16-
uses: actions/checkout@master
17-
with:
18-
# We must fetch at least the immediate parents so that if this is
19-
# a pull request then we can checkout the head.
20-
fetch-depth: 2
21-
22-
# If this run was triggered by a pull request event, then checkout
23-
# the head of the pull request instead of the merge commit.
24-
- run: git checkout HEAD^2
25-
if: ${{ github.event_name == 'pull_request' }}
16+
uses: actions/checkout@v5
2617

2718
# Initializes the CodeQL tools for scanning.
2819
- name: Initialize CodeQL
2920
uses: github/codeql-action/init@v3
30-
# Override language selection by uncommenting this and choosing your languages
31-
# with:
32-
# languages: go, javascript, csharp, python, cpp, java
21+
with:
22+
languages: python
3323

3424
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
3525
# If this step fails, then you should remove it and run the build manually (see below)

.github/workflows/dependabot-auto-approve-merge.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- name: Dependabot metadata
1414
id: metadata
15-
uses: dependabot/fetch-metadata@v2.4.0
15+
uses: dependabot/fetch-metadata@v2
1616
with:
1717
github-token: "${{ secrets.GITHUB_TOKEN }}"
1818

@@ -23,8 +23,8 @@ jobs:
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2424

2525
- name: Enable auto-merge for Dependabot PRs
26-
# if: ${{contains(steps.metadata.outputs.dependency-names, 'my-dependency') && steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
27-
run: gh pr merge --auto --merge "$PR_URL"
26+
# Auto-merge will wait for required status checks (tests) to pass
27+
run: gh pr merge --auto --squash "$PR_URL"
2828
env:
2929
PR_URL: ${{ github.event.pull_request.html_url }}
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 29 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,51 @@
1-
# Byte-compiled / optimized / DLL files
1+
# Python
22
__pycache__/
33
*.py[cod]
44
*$py.class
5-
6-
# C extensions
75
*.so
86

9-
# Distribution / packaging
10-
.Python
11-
env/
7+
# Virtual Environments
8+
.venv/
9+
venv/
10+
11+
# Distribution / Packaging
1212
build/
13-
develop-eggs/
1413
dist/
15-
downloads/
1614
eggs/
1715
.eggs/
18-
lib/
19-
lib64/
20-
parts/
21-
sdist/
22-
var/
2316
*.egg-info/
24-
.installed.cfg
2517
*.egg
2618

27-
# PyInstaller
28-
# Usually these files are written by a python script from a template
29-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30-
*.manifest
31-
*.spec
32-
33-
# Installer logs
34-
pip-log.txt
35-
pip-delete-this-directory.txt
36-
37-
# Unit test / coverage reports
38-
htmlcov/
39-
.tox/
19+
# Testing
20+
.pytest_cache/
4021
.coverage
4122
.coverage.*
42-
.cache
43-
nosetests.xml
44-
coverage-*.xml
45-
*,cover
46-
.hypothesis/
47-
junit-*.xml
48-
49-
# Translations
50-
*.mo
51-
*.pot
23+
htmlcov/
24+
coverage.xml
25+
junit.xml
5226

53-
# Django stuff:
27+
# Logs
5428
*.log
55-
local_settings.py
56-
57-
# Flask stuff:
58-
instance/
59-
.webassets-cache
6029

61-
# Scrapy stuff:
62-
.scrapy
63-
64-
# Sphinx documentation
65-
docs/_build/
66-
67-
# PyBuilder
68-
target/
69-
70-
# IPython Notebook
71-
.ipynb_checkpoints
72-
73-
# pyenv
74-
.python-version
75-
76-
# celery beat schedule file
77-
celerybeat-schedule
78-
79-
# dotenv
30+
# Environment Variables (Security)
8031
.env
32+
.env.*
33+
!.env.example
8134

82-
# virtualenv
83-
venv/
84-
ENV/
35+
# Python Version Management
36+
.python-version
8537

86-
# Spyder project settings
87-
.spyderproject
38+
# Poetry
39+
poetry.toml
40+
__pypackages__/
8841

89-
# Rope project settings
90-
.ropeproject
42+
# IDE
9143
.idea/
92-
junit.xml
93-
coverage.xml
44+
.vscode/
45+
*.swp
46+
*.swo
47+
*~
48+
49+
# OS
50+
.DS_Store
51+
Thumbs.db

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
1.1.1 - 2025-10-12
5+
==================
6+
- Migrated from `uv` to Poetry for dependency management to enable Dependabot support
7+
- Added `make update-deps` and `make lock` targets for dependency management
8+
- Updated build system to use Poetry while maintaining setuptools compatibility
9+
410
1.1.0 - 2024-12-21
511
==================
612
- Supported new option `--browser-autofill|-b` to enable browser-autofill in saml2aws

MANIFEST.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

Makefile

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,49 @@
11
# saml2aws-multi Makefile - Unit Testing Focus
22
# Provides targets for running unit tests locally
33

4-
.PHONY: help test test-coverage clean install-test-deps yamllint build check-uv
4+
.PHONY: help test test-coverage clean clean-all install-test-deps yamllint build check-poetry setup-venv update-deps lock
55

66
# Default target
77
help: ## Show this help message
88
@echo "Available targets:"
99
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
1010

1111
# Variables
12-
UV := uv
13-
PYTHON := $(UV) run python
14-
PIP := $(UV) run pip
15-
PYTEST := $(UV) run pytest
16-
BUILD := $(UV) run python -m build
12+
POETRY := poetry
13+
PYTHON := $(POETRY) run python
14+
PYTEST := $(POETRY) run pytest
15+
BUILD := $(POETRY) build
1716

18-
# Check if uv is available, install if not
19-
check-uv:
20-
@which uv > /dev/null || (echo "Installing uv..." && pip install uv)
17+
# Check if poetry is available, install if not
18+
check-poetry:
19+
@which poetry > /dev/null || (echo "Installing Poetry..." && pip install --user poetry && echo "Poetry installed successfully!")
20+
21+
# Configure Poetry to use project-local venv (run once)
22+
setup-venv: check-poetry ## Configure Poetry to use .venv in project directory
23+
@echo "Configuring Poetry for project-local virtualenv..."
24+
$(POETRY) config virtualenvs.in-project true
25+
@echo "Poetry will now create .venv/ in the project directory"
26+
@echo "This isolates dependencies from your global Python environment"
2127

2228
# Installation targets
23-
install-test-deps: check-uv ## Install test dependencies
29+
install-test-deps: check-poetry ## Install test dependencies
2430
@echo "Installing test dependencies..."
25-
$(PIP) install -e ".[test]"
31+
$(POETRY) install --with test
2632
@echo "Dependencies installed."
2733

28-
install-deps: check-uv ## Install project dependencies
34+
install-deps: check-poetry ## Install project dependencies
2935
@echo "Installing project dependencies..."
30-
$(PIP) install -e .
36+
$(POETRY) install
3137
@echo "Dependencies installed."
3238

3339
# Build targets
34-
build: check-uv ## Build the package
40+
build: check-poetry ## Build the package
3541
@echo "Building package..."
3642
$(BUILD)
3743
@echo "Package built successfully."
3844

3945
# Run targets (removed - awslogin is an interactive CLI tool)
4046

41-
4247
# Testing targets
4348
test: install-test-deps ## Run unit tests without coverage
4449
@echo "Running unit tests..."
@@ -52,6 +57,17 @@ test-coverage: install-test-deps ## Run unit tests with coverage reporting
5257
yamllint: ## Run yamllint on GitHub workflow files
5358
yamllint -c .github/linters/.yaml-lint.yaml .github/
5459

60+
# Dependency management
61+
update-deps: check-poetry ## Update dependencies to latest compatible versions
62+
@echo "Updating dependencies..."
63+
$(POETRY) update
64+
@echo "Dependencies updated in poetry.lock"
65+
66+
lock: check-poetry ## Regenerate poetry.lock from pyproject.toml
67+
@echo "Regenerating lock file..."
68+
$(POETRY) lock --no-update
69+
@echo "Lock file regenerated"
70+
5571
# Cleanup targets
5672
clean: ## Clean test artifacts, build artifacts and temporary files
5773
rm -rf .coverage*
@@ -60,9 +76,17 @@ clean: ## Clean test artifacts, build artifacts and temporary files
6076
rm -rf htmlcov/
6177
rm -rf build/
6278
rm -rf dist/
79+
rm -rf eggs/
80+
rm -rf .eggs/
6381
rm -rf *.egg-info/
82+
rm -rf *.egg
83+
rm -rf .pytest_cache/
6484
find . -type d -name __pycache__ -exec rm -rf {} +
65-
find . -type f -name "*.pyc" -delete
85+
find . -type f -name "*.py[cod]" -delete
86+
87+
clean-all: ## Clean everything including virtual environment
88+
$(MAKE) clean
89+
rm -rf .venv/
6690

6791
# Default target when no target is specified
6892
.DEFAULT_GOAL := help

0 commit comments

Comments
 (0)