Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into threeal/remove-re…
Browse files Browse the repository at this point in the history
…quest-ctx
  • Loading branch information
nicoddemus committed Oct 23, 2023
2 parents 367916f + 97d49fd commit 4f7a00a
Show file tree
Hide file tree
Showing 18 changed files with 139 additions and 110 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: deploy

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

jobs:

package:
runs-on: ubuntu-latest
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}

steps:
- uses: actions/checkout@v3

- name: Build and Check Package
uses: hynek/[email protected]

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@v3

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

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

- name: Push tag
run: |
git config user.name "pytest bot"
git config user.email "[email protected]"
git tag --annotate --message=${{ github.event.inputs.version }} ${{ github.event.inputs.version }} ${{ github.sha }}
git push origin ${{ github.event.inputs.version }}
- name: GitHub Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
tag_name: ${{ github.event.inputs.version }}
71 changes: 0 additions & 71 deletions .github/workflows/main.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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
steps:
- uses: actions/checkout@v3
- name: Build and Check Package
uses: hynek/[email protected]

test:

needs: [package]

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

strategy:
fail-fast: false
matrix:
python: ["3.7", "3.8", "3.9"]
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v3

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

- name: Set up Python
uses: actions/setup-python@v4
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`
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ htmlcov/
.coverage.*
.pytest_cache/
.eggs/
dist/
coverage.xml
tests/junit.xml

pytest_flask/_version.py
src/pytest_flask/_version.py

# Editors
.vscode
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
- id: rst
name: rst
entry: rst-lint --encoding utf-8
files: ^(HOWTORELEASE.rst|README.rst)$
files: ^(RELEASING.rst|README.rst)$
language: python
additional_dependencies: [pygments, restructuredtext_lint]
- repo: https://github.com/myint/autoflake.git
Expand Down
29 changes: 0 additions & 29 deletions HOWTORELEASE.rst

This file was deleted.

7 changes: 7 additions & 0 deletions RELEASING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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.
5. Merge the PR.
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools",
"setuptools-scm[toml]",
]
build-backend = "setuptools.build_meta"
2 changes: 1 addition & 1 deletion requirements/main.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pytest>=5.2
Flask
Flask <3.0
Werkzeug>=0.7
7 changes: 5 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ author = Vital Kudzelka
keywords = pytest, flask, testing
author_email = [email protected]
url = https://github.com/pytest-dev/pytest-flask
long_description = file: README.rst, CHANGELOG.rst, LICENSE
long_description = file: README.rst, docs/changelog.rst, LICENSE
long_description_content_type = text/x-rst
description = A set of py.test fixtures to test Flask applications.
project_urls =
Source = https://github.com/pytest-dev/pytest-flask
Expand All @@ -27,10 +28,12 @@ classifiers=
Topic :: Software Development :: Libraries :: Python Modules

[options]
packages = find:
packages = pytest_flask
zip_safe = False
python_requires = >= 3.7
setup_requires = setuptools_scm
package_dir =
=src

[options.packages.find]
exclude = docs, tests
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def read(*parts):

setup(
# Dependencies are here for GitHub's dependency graph.
use_scm_version={"write_to": "pytest_flask/_version.py"},
use_scm_version={"write_to": "src/pytest_flask/_version.py"},
install_requires=requirements,
tests_require=tests_require,
extras_require=extras_require,
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pytest_flask/fixtures.py → src/pytest_flask/fixtures.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_login(self):


@pytest.fixture(scope=_determine_scope)
def live_server(request, app, pytestconfig):
def live_server(request, app, pytestconfig): # pragma: no cover
"""Run application in a separate process.
When the ``live_server`` fixture is applied, the ``url_for`` function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
multiprocessing = multiprocessing.get_context("fork")


class LiveServer:
class LiveServer: # pragma: no cover
"""The helper class used to manage a live server. Handles creation and
stopping application in a separate process.
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ deps =
-rrequirements/main.txt
-rrequirements/test.txt

passenv = HOME LANG LC_ALL

commands =
coverage run -m pytest {posargs:tests}
coverage combine
Expand Down

0 comments on commit 4f7a00a

Please sign in to comment.