Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: se2p/pynguin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.34.0
Choose a base ref
...
head repository: se2p/pynguin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing 451 changed files with 15,953 additions and 9,795 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2019–2023 Pynguin Contributors
# SPDX-FileCopyrightText: 2019–2025 Pynguin Contributors
#
# SPDX-License-Identifier: CC0-1.0

2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2019–2023 Pynguin Contributors
# SPDX-FileCopyrightText: 2019–2025 Pynguin Contributors
#
# SPDX-License-Identifier: CC0-1.0

12 changes: 0 additions & 12 deletions .flake8

This file was deleted.

6 changes: 6 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-FileCopyrightText: 2019–2025 Pynguin Contributors
#
# SPDX-License-Identifier: MIT

# Replace black with ruff-format
0729abe647ddd0ab6a7fc33fbbcec10a16819d07
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md.license
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SPDX-FileCopyrightText: 2019–2023 Pynguin Contributors
SPDX-FileCopyrightText: 2019–2025 Pynguin Contributors

SPDX-License-Identifier: CC0-1.0
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md.license
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SPDX-FileCopyrightText: 2019–2023 Pynguin Contributors
SPDX-FileCopyrightText: 2019–2025 Pynguin Contributors

SPDX-License-Identifier: CC0-1.0
20 changes: 7 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2019–2023 Pynguin Contributors
# SPDX-FileCopyrightText: 2019–2025 Pynguin Contributors
#
# SPDX-License-Identifier: MIT

@@ -11,37 +11,31 @@ jobs:
fail-fast: false
matrix:
python-version: ['3.10']
poetry-version: [1.5.1]
poetry-version: [2.0.1]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Setup Poetry
uses: abatilo/actions-poetry@v2.0.0
uses: abatilo/actions-poetry@v4
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Install dependencies
run: poetry install

- name: Check imports with isort
run: poetry run isort --check-only . --profile black

- name: Check formatting with black
run: poetry run black --diff --check .
- name: Run the hooks from pre-commit
run: poetry run pre-commit run --all-files

- name: Check typing with mypy
run: poetry run mypy

- name: Linting with ruff
run: poetry run ruff src/pynguin

- name: Run tests
run: poetry run pytest --cov=src --cov=tests --cov-branch --cov-report=term-missing tests/
117 changes: 117 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# SPDX-FileCopyrightText: 2019–2025 Pynguin Contributors
#
# SPDX-License-Identifier: MIT

name: Publish Python 🐍 distribution 📦 to PyPI

on: push

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: "2.0.1"

- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}

- name: Install the project dependencies
run: poetry install

- name: Build a binary wheel and a source tarball
run: poetry build

- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pynguin
permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v3.0.0
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2019–2023 Pynguin Contributors
# SPDX-FileCopyrightText: 2019–2025 Pynguin Contributors
#
# SPDX-License-Identifier: CC0-1.0

58 changes: 17 additions & 41 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2019–2023 Pynguin Contributors
# SPDX-FileCopyrightText: 2019–2025 Pynguin Contributors
#
# SPDX-License-Identifier: MIT

@@ -43,18 +43,12 @@ before_script:
report.xml
paths:
- cov_html
needs: ["isort", "black", "reuse"]
needs: ["pre-commit", "reuse"]

unit-tests:python-3.10:
<<: *unit-tests
variables:
PYTHON_VERSION: '3.10-bullseye'

#unit-tests:python-3.11:
# <<: *unit-tests
# allow_failure: true
# variables:
# PYTHON_VERSION: '3.11-rc-bullseye'
PYTHON_VERSION: '3.10-bookworm'

.nightly-tests:
only:
@@ -67,63 +61,45 @@ unit-tests:python-3.10:
- poetry install
- poetry add --group dev pytest-random-order
script:
- for ((i=1; i<=10; i++)); do echo "test run ${i}\n"; poetry run pytest -q --cov=pynguin --cov=tests --cov-branch --random-order --random-order-bucket=global ; done
- for ((i=1; i<=10; i++)); do SECONDS=0; echo "test run ${i}\n"; poetry run pytest -q --cov=pynguin --cov=tests --cov-branch --random-order --random-order-bucket=global ; elapsed=$SECONDS; echo "=== required ${elapsed} seconds for run ${i} ===\n\n" ; done
needs: ["unit-tests:python-3.10"]

nightly-tests:python-3.10:
extends: .nightly-tests
variables:
PYTHON_VERSION: '3.10-bullseye'

#nightly-tests:python-3.11:
# extends: .nightly-tests
# allow_failure: true
# variables:
# PYTHON_VERSION: '3.11-rc-bullseye'
PYTHON_VERSION: '3.10-bookworm'

memory-profile:
only:
- schedules
stage: lint
image: python:3.10-bullseye
image: python:3.10-bookworm
before_script:
- pip install poetry
- poetry config virtualenvs.in-project true
- poetry install
- poetry add --dev memray pytest-memray
- poetry add --group dev memray pytest-memray
script:
- poetry run pytest --memray tests/
needs: ["isort", "black", "reuse"]
needs: ["pre-commit", "reuse"]

mypy:
pre-commit:
stage: lint
image: python:3.10-bullseye
image: python:3.10-bookworm
script:
- poetry run mypy
needs: ["isort", "black"]
- poetry run pre-commit run --all-files
needs: []

ruff:
mypy:
stage: lint
image: python:3.10-bullseye
image: python:3.10-bookworm
script:
- poetry run ruff src/pynguin
needs: ["isort", "black"]

isort:
stage: build
image: python:3.10-bullseye
script:
- poetry run isort **/*.py -c -v --profile black

black:
stage: build
image: python:3.10-bullseye
script:
- poetry run black --check .
- poetry run mypy
needs: ["pre-commit"]

sphinx:
stage: build
image: python:3.10-bullseye
image: python:3.10-bookworm
script:
- poetry run sphinx-build docs docs/_build
artifacts:
43 changes: 26 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,51 @@
# SPDX-FileCopyrightText: 2019–2023 Pynguin Contributors
# SPDX-FileCopyrightText: 2019–2025 Pynguin Contributors
#
# SPDX-License-Identifier: MIT

default_language_version:
python: python3.10

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
args: [ --fix=lf ]
- id: pretty-format-json
args: [ --autofix ]
- id: trailing-whitespace

- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
- repo: https://github.com/python-poetry/poetry
rev: 2.0.1
hooks:
- id: pyupgrade
args: [--py310-plus]
- id: poetry-check
- id: poetry-lock
- id: poetry-install

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 6.0.0
hooks:
- id: isort
args: [--profile, black]
args: [ --profile, black ]

- repo: https://github.com/psf/black
rev: 23.7.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6
hooks:
- id: black
args: [--config, ./pyproject.toml]
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/fsfe/reuse-tool
rev: v2.1.0
rev: v5.0.2
hooks:
- id: reuse
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2019–2023 Pynguin Contributors
# SPDX-FileCopyrightText: 2019–2025 Pynguin Contributors
#
# SPDX-License-Identifier: MIT

Loading