Skip to content

Commit 61ca2e6

Browse files
authored
Merge pull request #29 from BeyondEvil/switch-to-pyproject
Switch to pyproject.toml
2 parents 3aeded8 + a8edd96 commit 61ca2e6

File tree

17 files changed

+873
-155
lines changed

17 files changed

+873
-155
lines changed

.github/workflows/nightly.yml

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

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ __pycache__
22
*.egg-info/
33
*.pyc
44
.cache
5-
.DS_Store
65
.tox
76
.eggs
8-
.vscode/
97
build
108
dist

.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-base-url:
2727

28-
- Python 2.7, 3.6, PyPy, or PyPy3
29-
- py.test 2.7 or newer
28+
- Python 3.7+ or PyPy3
3029

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

development.rst

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

4-
To contribute to `pytest-base-url` you can use `Pipenv`_ to manage
4+
To contribute to `pytest-base-url` 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
@@ -23,30 +23,21 @@ If you're not using `Pipenv`_, to install `pre-commit`, run:
2323
Automated Testing
2424
-----------------
2525

26-
All pull requests and merges are tested in `Travis CI <https://travis-ci.org/>`_
27-
based on the ``.travis.yml`` file.
28-
29-
Usually, a link to your specific travis build appears in pull requests, but if
30-
not, you can find it on the
31-
`pull requests page <https://travis-ci.org/pytest-dev/pytest-base-url/pull_requests>`_
32-
33-
The only way to trigger Travis CI to run again for a pull request, is to submit
34-
another change to the pull branch.
35-
36-
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``.
3728

3829
Running Tests
3930
-------------
4031

41-
You will need `Tox <http://tox.testrun.org/>`_ installed to run the tests
42-
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
4334
installed for you.
4435

45-
With `Pipenv`_, run:
36+
With ``Poetry``, run:
4637

4738
.. code-block:: bash
4839
49-
$ pipenv run tox
40+
$ poetry run tox
5041
5142
Otherwise, to install and run, do:
5243

@@ -60,11 +51,12 @@ Releasing a new version
6051

6152
Follow these steps to release a new version of the project:
6253

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