Skip to content
Merged
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
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Keep GitHub Actions up to date with GitHub's Dependabot...
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
version: 2
updates:
- package-ecosystem: github-actions
directory: /
groups:
github-actions:
patterns:
- "*" # Group all Actions updates into a single larger pull request
schedule:
interval: weekly
42 changes: 0 additions & 42 deletions .github/workflows/build-package.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: deploy

on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
default: '1.2.3'

jobs:

package:
runs-on: ubuntu-latest
# Required by attest-build-provenance-github.
permissions:
id-token: write
attestations: write
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}

steps:
- uses: actions/checkout@v4

- name: Build and Check Package
uses: hynek/[email protected]
with:
attest-build-provenance-github: 'true'


deploy:
needs: package
runs-on: ubuntu-latest
environment: deploy
permissions:
id-token: write # For PyPI trusted publishers.
contents: write # For tag and release notes.

steps:
- uses: actions/checkout@v4

- name: Download Package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist

- name: Publish package to PyPI
uses: pypa/[email protected]
with:
attestations: true

- name: Push tag
run: |
git config user.name "pytest bot"
git config user.email "[email protected]"
git tag --annotate --message=v${{ github.event.inputs.version }} v${{ github.event.inputs.version }} ${{ github.sha }}
git push origin v${{ github.event.inputs.version }}

- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: scripts/latest-release-notes.md
files: dist/*
tag_name: v${{ github.event.inputs.version }}
35 changes: 0 additions & 35 deletions .github/workflows/publish-package.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: test

on:
push:
branches:
- main
- "test-me-*"

pull_request:


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

package:
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
steps:
- uses: actions/checkout@v4
- name: Build and Check Package
uses: hynek/[email protected]

test:

needs: [package]

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v4

- name: Download Package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist

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

- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox

- name: Test
shell: bash
run: |
tox run -e py --installpkg `find dist/*.tar.gz`
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: local
hooks:
- id: rst
name: rst
entry: rst-lint --encoding utf-8
files: ^(CHANGELOG.rst|README.rst|HOWTORELEASE.rst)$
language: python
additional_dependencies: [pygments, restructuredtext_lint]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.3
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
58 changes: 58 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

--------------
Changelog
--------------

UNRELEASED
++++++++++

* Dropped support for EOL Python versions and added support for Python 3.13.

v1.1.1 (2024-01-20)
+++++++++++++++++++

* Fixes #54 - ``AttributeError`` when cacheprovider plugin disabled. Thanks @jhanm12


v1.1.0 (2022-12-03)
+++++++++++++++++++

* Fixes xdist support (thanks @matejsp)


v1.0.4 (2018-11-30)
+++++++++++++++++++

* Fixes issues with doctests reported in #36 - ``class``, ``package`` and ``module`` didn't work
because ``DoctestItem`` doesn't have ``cls`` or ``module`` attributes. Thanks @tobywf.
* Deprecate ``none`` bucket type. **Update**: this was a mistake, it will be kept for backwards compatibility.
* With tox, run tests of pytest-random-order with both pytest 3 and 4.

v1.0.3 (2018-11-16)
+++++++++++++++++++

* Fixes compatibility issues with pytest 4.0.0, works with pytest 3.0+ as before.
* Tests included in the source distribution.

v1.0.0 (2018-10-20)
+++++++++++++++++++

* Plugin no longer alters the test order by default. You will have to either 1) pass ``--random-order``,
or ``--random-order-bucket=<bucket>``, or ``--random-order-seed=<seed>``, or
2) edit your pytest configuration file and add one of these options
there under ``addopts``, or 3) specify these flags in environment variable ``PYTEST_ADDOPTS``.
* Python 3.5+ is required. If you want to use this plugin with Python 2.7, use v0.8.0 which is stable and fine
if you are happy with it randomising the test order by default.
* The name under which the plugin registers itself is changed from ``random-order`` (hyphen) to ``random_order``
(underscore). This addresses the issue of consistency when disabling or enabling this plugin via the standard
``-p`` flag. Previously, the plugin could be disabled by passing ``-p no:random-order`` yet re-enabled
only by passing ``-p pytest_random_order.plugin``. Now they are ``-p no:random_order``
to disable and ``-p random_order.plugin`` to enable (The ``.plugin`` bit, I think, is required because
pytest probably thinks it's an unrelated thing to ``random_order`` and import it, yet without it it's the
same thing so doesn't import it).


v0.8.0
++++++

* pytest cache plugin's ``--failed-first`` works now.
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

52 changes: 0 additions & 52 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,58 +228,6 @@ pass undeservedly, you can disable it:
Note that randomisation is disabled by default. By passing ``-p no:random_order`` you are stopping the plugin
from being registered so its hooks won't be registered and its command line options won't appear in ``--help``.

--------------
Changelog
--------------

v1.1.1 (2024-01-20)
+++++++++++++++++++

* Fixes #54 - ``AttributeError`` when cacheprovider plugin disabled. Thanks @jhanm12


v1.1.0 (2022-12-03)
+++++++++++++++++++

* Fixes xdist support (thanks @matejsp)


v1.0.4 (2018-11-30)
+++++++++++++++++++

* Fixes issues with doctests reported in #36 - ``class``, ``package`` and ``module`` didn't work
because ``DoctestItem`` doesn't have ``cls`` or ``module`` attributes. Thanks @tobywf.
* Deprecate ``none`` bucket type. **Update**: this was a mistake, it will be kept for backwards compatibility.
* With tox, run tests of pytest-random-order with both pytest 3 and 4.

v1.0.3 (2018-11-16)
+++++++++++++++++++

* Fixes compatibility issues with pytest 4.0.0, works with pytest 3.0+ as before.
* Tests included in the source distribution.

v1.0.0 (2018-10-20)
+++++++++++++++++++

* Plugin no longer alters the test order by default. You will have to either 1) pass ``--random-order``,
or ``--random-order-bucket=<bucket>``, or ``--random-order-seed=<seed>``, or
2) edit your pytest configuration file and add one of these options
there under ``addopts``, or 3) specify these flags in environment variable ``PYTEST_ADDOPTS``.
* Python 3.5+ is required. If you want to use this plugin with Python 2.7, use v0.8.0 which is stable and fine
if you are happy with it randomising the test order by default.
* The name under which the plugin registers itself is changed from ``random-order`` (hyphen) to ``random_order``
(underscore). This addresses the issue of consistency when disabling or enabling this plugin via the standard
``-p`` flag. Previously, the plugin could be disabled by passing ``-p no:random-order`` yet re-enabled
only by passing ``-p pytest_random_order.plugin``. Now they are ``-p no:random_order``
to disable and ``-p random_order.plugin`` to enable (The ``.plugin`` bit, I think, is required because
pytest probably thinks it's an unrelated thing to ``random_order`` and import it, yet without it it's the
same thing so doesn't import it).


v0.8.0
++++++

* pytest cache plugin's ``--failed-first`` works now.

-------
Credits
Expand Down
12 changes: 12 additions & 0 deletions RELEASING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Here are the steps on how to make a new release.

1. Create a ``release-VERSION`` branch from ``upstream/main``.
2. Update ``CHANGELOG.rst``.
3. Push the branch to ``upstream``.
4. Once all tests pass, start the ``deploy`` workflow manually or via:

```
gh workflow run deploy.yml --repo pytest-dev/pytest-mock --ref release-VERSION -f version=VERSION
```

5. Merge the PR.
13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[build-system]
requires = [
"setuptools",
"setuptools-scm>=8",
]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-r a"

[tool.ruff]
line-length = 120
3 changes: 0 additions & 3 deletions pytest.ini

This file was deleted.

Loading