Skip to content

Commit ad90665

Browse files
authored
Merge pull request #32 from BeyondEvil/switch-to-pyproject
Switch to pyproject.toml
2 parents 2578fd3 + 90e5aee commit ad90665

File tree

17 files changed

+812
-149
lines changed

17 files changed

+812
-149
lines changed

.github/workflows/nightly.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Nightly tests
2+
3+
on:
4+
schedule:
5+
- cron: '1 0 * * *' # Run daily at 0:01 UTC
6+
7+
jobs:
8+
tests:
9+
uses: ./.github/workflows/test.yml

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: "3.9"
17+
- name: Install poetry
18+
run: curl -sSL https://install.python-poetry.org | python3 -
19+
- name: Configure poetry
20+
run: poetry config virtualenvs.in-project true
21+
- name: Set up cache
22+
uses: actions/cache@v3
23+
with:
24+
path: .venv
25+
key: venv-${{ hashFiles('**/poetry.lock') }}
26+
restore-keys: venv-
27+
- name: Install Dependencies
28+
run: poetry install
29+
- name: Publish
30+
run: >-
31+
poetry publish
32+
--build
33+
--username __token__
34+
--password ${{ secrets.PYPI_TOKEN }}

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags-ignore:
8+
- v*
9+
pull_request:
10+
11+
jobs:
12+
test:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python: ["3.7", "3.8", "3.9", "3.10", "pypy-3.8"]
18+
os: [ubuntu-latest, windows-latest]
19+
include:
20+
- python: "3.7"
21+
tox_env: "py37"
22+
- python: "3.8"
23+
tox_env: "py38"
24+
- python: "3.9"
25+
tox_env: "py39"
26+
- python: "3.10"
27+
tox_env: "py310"
28+
- python: "pypy-3.8"
29+
tox_env: "pypy3"
30+
steps:
31+
- uses: actions/checkout@v3
32+
- name: Set up Python
33+
uses: actions/setup-python@v3
34+
with:
35+
python-version: ${{ matrix.python }}
36+
- name: Install tox
37+
run: |
38+
python -m pip install --upgrade pip
39+
pip install tox
40+
- name: Cache tox environments
41+
uses: actions/cache@v3
42+
with:
43+
path: .tox
44+
key: tox-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}
45+
- name: Test
46+
run: tox -e ${{ matrix.tox_env }}

.pre-commit-config.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
repos:
2-
3-
- repo: https://github.com/psf/black
4-
rev: stable
2+
- repo: https://github.com/psf/black
3+
rev: 22.1.0
54
hooks:
6-
- id: black
5+
- id: black
76
args: [--safe, --quiet]
87
language_version: python3
98

10-
- repo: https://gitlab.com/pycqa/flake8
11-
rev: 3.7.7
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v4.1.0
11+
hooks:
12+
- id: trailing-whitespace
13+
- id: end-of-file-fixer
14+
15+
- repo: https://gitlab.com/PyCQA/flake8
16+
rev: 4.0.1
1217
hooks:
13-
- id: flake8
18+
- id: flake8
1419
exclude: docs
1520
language_version: python3

.travis.yml

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

Pipfile

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

README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ Requirements
2525

2626
You will need the following prerequisites in order to use pytest-variables:
2727

28-
- Python 2.7, 3.6, PyPy, or PyPy3
29-
- pytest 2.6 or newer
28+
- Python 3.7+ or PyPy3
3029

3130
Installation
3231
------------

development.rst

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,43 @@
11
Development
22
===========
33

4-
To contribute to `pytest-variables` you can use `Pipenv`_ to manage
4+
To contribute to `pytest-variables` you can use `Poetry <https://python-poetry.org/>`_ to manage
55
a python virtual environment and `pre-commit <https://pre-commit.com/>`_ to help you with
66
styling and formatting.
77

88
To setup the virtual environment and pre-commit, run:
99

1010
.. code-block:: bash
1111
12-
$ pipenv install --dev
13-
$ pipenv run pre-commit install
12+
$ poetry install
13+
$ poetry run pre-commit install
1414
15-
If you're not using `Pipenv`_, to install `pre-commit`, run:
15+
If you're not using ``Poetry``, to install ``pre-commit``, run:
1616

1717
.. code-block:: bash
1818
1919
$ pip install pre-commit
2020
$ pre-commit install
2121
22+
2223
Automated Testing
2324
-----------------
2425

25-
All pull requests and merges are tested in `Travis CI <https://travis-ci.org/>`_
26-
based on the ``.travis.yml`` file.
27-
28-
Usually, a link to your specific travis build appears in pull requests, but if
29-
not, you can find it on the
30-
`pull requests page <https://travis-ci.org/pytest-dev/pytest-variables/pull_requests>`_
31-
32-
The only way to trigger Travis CI to run again for a pull request, is to submit
33-
another change to the pull branch.
34-
35-
You can do this with `git commit --allow-empty`
26+
All pull requests and merges are tested in `GitHub Actions <https://docs.github.com/en/actions>`_
27+
based on the workflows defined in ``.github/workflows``.
3628

3729
Running Tests
3830
-------------
3931

40-
You will need `Tox <http://tox.testrun.org/>`_ installed to run the tests
41-
against the supported Python versions. If you're using `Pipenv`_ it will be
32+
You will need `Tox <https://tox.wiki/en/latest/>`_ installed to run the tests
33+
against the supported Python versions. If you're using ``Poetry`` it will be
4234
installed for you.
4335

44-
With `Pipenv`_, run:
36+
With ``Poetry``, run:
4537

4638
.. code-block:: bash
4739
48-
$ pipenv run tox
40+
$ poetry run tox
4941
5042
Otherwise, to install and run, do:
5143

@@ -59,11 +51,12 @@ Releasing a new version
5951

6052
Follow these steps to release a new version of the project:
6153

62-
1. Update your local master with the upstream master (``git pull --rebase upstream master``)
63-
2. Create a new branch and update ``CHANGES.rst`` with the new version, today's date, and all changes/new features
64-
3. Commit and push the new branch and then create a new pull request
65-
4. Wait for tests and reviews and then merge the branch
66-
5. Once merged, update your local master again (``git pull --rebase upstream master``)
67-
6. Tag the release with the new release version (``git tag v<new tag>``)
68-
7. Push the tag (``git push upstream --tags``)
69-
8. Done. You can monitor the progress on `Travis <https://travis-ci.org/pytest-dev/pytest-variables/>`_
54+
#. Update your local master with the upstream master (``git pull --rebase upstream master``)
55+
#. Create a new branch and update ``CHANGES.rst`` with the new version, today's date, and all changes/new features
56+
#. Update ``pyproject.toml`` with the new version
57+
#. Commit and push the new branch and then create a new pull request
58+
#. Wait for tests and reviews and then merge the branch
59+
#. Once merged, update your local master again (``git pull --rebase upstream master``)
60+
#. Tag the release with the new release version (``git tag v<new tag>``)
61+
#. Push the tag (``git push upstream --tags``)
62+
#. Done.

0 commit comments

Comments
 (0)