Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0144e51
chore: upgrade dependencies to latest stable and require Python 3.11+
ebubekirrcihangirr6060 Oct 21, 2026
6a4c1b6
refactor: modernize codebase for Python 3.11
ebubekirrcihangirr6060 Oct 21, 2026
ee2657c
ci: update GitHub Actions to current major versions
ebubekirrcihangirr6060 Oct 21, 2026
e3144bd
refactor: use | syntax for the remaining Union type aliases
ebubekirrcihangirr6060 Oct 21, 2026
d1c754a
fix: correct Singleton, Context Manager and Repository pattern defects
ebubekirrcihangirr6060 Oct 21, 2026
bbb7839
fix: add hypothesis as a runtime dependency so the eg CLI works after…
ebubekirrcihangirr6060 Nov 4, 2026
a6470d3
fix(cli): decrypt with a quorum of guardians when some are missing
ebubekirrcihangirr6060 Nov 4, 2026
95ff23f
fix(cli): publish guardian records for missing guardians too
ebubekirrcihangirr6060 Nov 4, 2026
ba473dd
fix: log per-selection encryption traces at debug level
ebubekirrcihangirr6060 Nov 4, 2026
95fe78b
fix(group): keep negate_q(0) inside [0, q)
ebubekirrcihangirr6060 Nov 5, 2026
d8eaef0
chore: refresh dependencies to the latest releases
ebubekirrcihangirr6060 Nov 5, 2026
6e5cf1b
chore: bump pydantic, click and hypothesis to the latest patch releases
ebubekirrcihangirr6060 Nov 6, 2026
75d77e8
test: replace the skipped overvote test with one for current behaviour
ebubekirrcihangirr6060 Nov 6, 2026
45256d8
fix(group): remove the rejection loop from rand_range_q
ebubekirrcihangirr6060 Nov 7, 2026
3c4f1f8
fix(discrete_log): fail fast on values with no exponent in range
ebubekirrcihangirr6060 Nov 7, 2026
1edf66d
fix(tools): generate unique candidate ids in well-formed contests
ebubekirrcihangirr6060 Nov 7, 2026
2234e6e
test: filter the eel deprecation warnings
ebubekirrcihangirr6060 Nov 7, 2026
62f6f47
test: remove fixed deadlines from property tests
ebubekirrcihangirr6060 Nov 7, 2026
905da2c
fix(discrete_log): do not cache every step to a large exponent
ebubekirrcihangirr6060 Nov 7, 2026
7e41533
fix(nonces): never derive a zero nonce
ebubekirrcihangirr6060 Nov 7, 2026
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
30 changes: 15 additions & 15 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- cron: "30 23 * * 1" # 2330 UTC Every Monday

env:
PYTHON_VERSION: 3.9
PYTHON_VERSION: "3.11"

jobs:
code_analysis:
Expand All @@ -27,13 +27,13 @@ jobs:
language: ["python"]
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v7
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: Change Directory
run: cd ${{ github.workspace }}
- name: Setup Environment
Expand All @@ -43,26 +43,26 @@ jobs:
- name: Lint
run: make lint
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v4
with:
languages: "${{ matrix.language }}"
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v4

linux_check:
name: Linux Check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v7
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: Change Directory
run: cd ${{ github.workspace }}
- name: Setup Environment
Expand All @@ -72,7 +72,7 @@ jobs:
- name: Build
run: make build validate
- name: Full Test Suite & Coverage
uses: nick-fields/retry@v2
uses: nick-fields/retry@v4
with:
timeout_minutes: 10
max_attempts: 1
Expand All @@ -84,13 +84,13 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v7
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: Change Directory
run: cd ${{ github.workspace }}
- name: Setup Environment
Expand All @@ -100,7 +100,7 @@ jobs:
- name: Build
run: make build validate
- name: Integration Tests
uses: nick-fields/retry@v2
uses: nick-fields/retry@v4
with:
timeout_minutes: 3
max_attempts: 1
Expand Down
62 changes: 25 additions & 37 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ on:
types: [closed]

env:
PYTHON_VERSION: 3.9
PYTHON_VERSION: "3.11"

jobs:
code_analysis:
name: Code Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v7
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: Change Directory
run: cd ${{ github.workspace }}
- name: Setup Environment
Expand All @@ -29,26 +29,26 @@ jobs:
- name: Lint
run: make lint
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v4
with:
languages: python
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v4

linux_check:
name: Linux Check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v7
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: Change Directory
run: cd ${{ github.workspace }}
- name: Setup Environment
Expand All @@ -65,13 +65,13 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v7
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v2
uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: Change Directory
run: cd ${{ github.workspace }}
- name: Setup Environment
Expand All @@ -89,13 +89,13 @@ jobs:
needs: [code_analysis, mac_check, linux_check]
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v7
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v1
uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: Change Directory
run: cd ${{ github.workspace }}
- name: Setup Environment
Expand All @@ -108,27 +108,17 @@ jobs:
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
- name: Generate release notes
run: make release-notes
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.PACKAGE_VERSION }}
release_name: Release ${{ env.PACKAGE_VERSION }}
draft: false
prerelease: false
- name: Dependency Graph
run: make dependency-graph-ci
- name: Upload Dependency Graph as Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: dependency-graph
path: dependency-graph.svg
- name: Build
run: make build
- name: Upload Package as Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: package
path: dist/
Expand All @@ -139,15 +129,13 @@ jobs:
run: make publish-ci
- name: Zip Artifacts
run: make release-zip-ci
- name: Add Artifacts to Release
id: upload-release-asset_1
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v3
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./electionguard.zip
asset_name: electionguard.zip
asset_content_type: application/zip
tag_name: ${{ env.PACKAGE_VERSION }}
name: Release ${{ env.PACKAGE_VERSION }}
draft: false
prerelease: false
files: ./electionguard.zip
- name: Deploy Github Pages
run: make docs-deploy-ci
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ElectionGuard supports a variety of use cases. The Primary use case is to genera

## 💻 Requirements

- [Python 3.9+](https://www.python.org/downloads/) is <ins>**required**</ins> to develop this SDK. If developer uses multiple versions of python, [pyenv](https://github.com/pyenv/pyenv) is suggested to assist version management.
- [Python 3.11+](https://www.python.org/downloads/) is <ins>**required**</ins> to develop this SDK. If developer uses multiple versions of python, [pyenv](https://github.com/pyenv/pyenv) is suggested to assist version management.
- [GNU Make](https://www.gnu.org/software/make/manual/make.html) is used to simplify the commands and GitHub Actions. This approach is recommended to simplify the command line experience. This is built in for MacOS and Linux. For Windows, setup is simpler with [Chocolatey](https://chocolatey.org/install) and installing the provided [make package](https://chocolatey.org/packages/make). The other Windows option is [manually installing make](http://gnuwin32.sourceforge.net/packages/make.htm).
- [Gmpy2](https://gmpy2.readthedocs.io/en/latest/) is used for [Arbitrary-precision arithmetic](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic) which
has its own [installation requirements (native C libraries)](https://gmpy2.readthedocs.io/en/latest/intro.html#installation) on Linux and MacOS. **⚠️ Note:** _This is not required for Windows since the gmpy2 precompiled libraries are provided._
Expand Down
2 changes: 1 addition & 1 deletion docs/0_Configure_Election.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"\n",
"# get an `InternalElectionDescription` and `CiphertextElectionContext`\n",
"# that are used for the remainder of the election.\n",
"(internal_manifest, context) = builder.build()"
"internal_manifest, context = builder.build()"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ElectionGuard supports a variety of use cases. The Primary use case is to genera

## 💻 Requirements

- [Python 3.9+](https://www.python.org/downloads/) is <ins>**required**</ins> to develop this SDK. If developer uses multiple versions of python, [pyenv](https://github.com/pyenv/pyenv) is suggested to assist version management.
- [Python 3.11+](https://www.python.org/downloads/) is <ins>**required**</ins> to develop this SDK. If developer uses multiple versions of python, [pyenv](https://github.com/pyenv/pyenv) is suggested to assist version management.
- [GNU Make](https://www.gnu.org/software/make/manual/make.html) is used to simplify the commands and GitHub Actions. This approach is recommended to simplify the command line experience. This is built in for MacOS and Linux. For Windows, setup is simpler with [Chocolatey](https://chocolatey.org/install) and installing the provided [make package](https://chocolatey.org/packages/make). The other Windows option is [manually installing make](http://gnuwin32.sourceforge.net/packages/make.htm).
- [Gmpy2](https://gmpy2.readthedocs.io/en/latest/) is used for [Arbitrary-precision arithmetic](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic) which
has its own [installation requirements (native C libraries)](https://gmpy2.readthedocs.io/en/latest/intro.html#installation) on Linux and MacOS. **⚠️ Note:** _This is not required for Windows since the gmpy2 precompiled libraries are provided._
Expand Down
61 changes: 36 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "electionguard"
version = "1.4.0"
requires-python = ">=3.9.5,<4.0.0"
requires-python = ">=3.11,<4.0.0"
description = "ElectionGuard: Support for e2e verified elections."
license = "MIT"
authors = [{"name" = "Microsoft", "email" = "electionguard@microsoft.com"}]
Expand All @@ -19,17 +19,17 @@ classifiers = [
"Topic :: Utilities"
]
dependencies = [
"gmpy2>=2.0.8,<3.0.0",
"psutil>=5.7.2",
"pydantic==2.13.0",
"click>=8.1.0,<9.0.0",
"dacite>=1.6.0,<2.0.0",
"python-dateutil>=2.8.2,<3.0.0",
"types-python-dateutil>=2.8.14,<3.0.0",
"Eel[jinja2]>=0.14.0,<1.0.0",
"pymongo>=4.1.1,<5.0.0",
"dependency-injector>=4.39.1,<5.0.0",
"pytest-mock>=3.8.2,<4.0.0",
"gmpy2>=2.3.2,<3.0.0",
"psutil>=7.2.2",
"pydantic>=2.14.3,<3.0.0",
"click>=8.5.1,<9.0.0",
"dacite>=1.9.2,<2.0.0",
"python-dateutil>=4.0.0,<5.0.0",
"Eel[jinja2]>=0.18.2,<1.0.0",
"pymongo>=4.19.0,<5.0.0",
"dependency-injector>=4.49.1,<5.0.0",
# electionguard_tools (used by the eg CLI) builds ballots with hypothesis strategies
"hypothesis>=6.170.15",
]

[project.urls]
Expand All @@ -45,21 +45,22 @@ documentation = "https://Election-Tech-Initiative.github.io/electionguard-python
[dependency-groups]
dev = [
"atomicwrites",
"black==25.11.0",
"coverage",
"black==26.10.1",
"coverage>=7.17.2",
"docutils",
"hypothesis>=5.15.1",
"ipykernel>=6.4.1,<7.0.0",
"ipython>=7.31.1,<8.0.0",
"ipykernel>=7.4.0,<8.0.0",
"ipython>=9.18.1,<10.0.0",
"jeepney",
"jupyter-black>=0.3.1,<0.4.0",
"jupyter-black>=0.4.0,<0.5.0",
"mkdocs>=1.6.1,<2.0.0",
"mkdocs-jupyter>=0.26.2,<0.27.0",
"mkdocs-jupyter>=0.26.3,<0.28.0",
"mkinit",
"mypy==1.19.1",
"mypy==2.4.1",
"pydeps",
"pylint",
"pytest",
"pylint>=4.1.3",
"pytest>=9.2.0",
"pytest-mock>=3.17.0",
"types-python-dateutil>=2.9.0.20261104",
"secretstorage",
"twine",
"typish",
Expand All @@ -70,14 +71,21 @@ eg = 'electionguard_cli.start:cli'
egui = 'electionguard_gui.start:run'

[build-system]
requires = ["uv_build>=0.11.14,<0.12"]
requires = ["uv_build>=0.13.4,<0.14"]
build-backend = "uv_build"

[tool.uv.build-backend]
module-name = ["electionguard", "electionguard_cli", "electionguard_gui", "electionguard_tools"]

[tool.pytest.ini_options]
filterwarnings = [
# This hides the warnings rather than fixing them: eel 0.18.2 uses names pyparsing has
# deprecated, and only eel can change that. Remove this once eel stops using them.
"ignore:.*deprecated.*:DeprecationWarning:eel",
]

[tool.black]
target-version = ['py39']
target-version = ['py311']

[tool.pylint.basic]
extension-pkg-whitelist = "pydantic"
Expand All @@ -86,10 +94,13 @@ extension-pkg-whitelist = "pydantic"
max-line-length = 120

# FIXME: Pylint should not require this many exceptions
# cyclic-import, import-self: pylint 4.1 false positives on mkinit __init__ files whose submodule names start with the package name
[tool.pylint.messages_control]
disable = '''
cyclic-import,
duplicate-code,
fixme,
import-self,
invalid-name,
missing-module-docstring,
missing-function-docstring,
Expand All @@ -115,7 +126,7 @@ source = ["src/electionguard"]
directory = "coverage_html_report"

[tool.mypy]
python_version = "3.9"
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
Expand Down
Loading