Repository: pytest-dev/pytest-flask (language: python)

Issue:
tox4 values cannot contain whitespace
**Describe the bug**
tox4 does not support pass_env values with whitespace in tox.ini

**To Reproduce**
`$ tox -e dev`

**Output**
`tox.tox_env.errors.Fail: pass_env values cannot contain whitespace, use comma to have multiple values in a single line, invalid values found 'HOME LANG LC_ALL'`

**Environment (please complete the following information):**
 - OS: macOS Ventura
 - Python Version: 3.10
 - pytest-flask version: 1.0.1


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
new file mode 100644
index 0000000..bc1ae15
--- /dev/null
+++ b/.github/workflows/deploy.yml
@@ -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/build-and-inspect-python-package@v1.5
+
+  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/gh-action-pypi-publish@v1.8.5
+
+    - name: Push tag
+      run: |
+        git config user.name "pytest bot"
+        git config user.email "pytestbot@gmail.com"
+        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 }}
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
deleted file mode 100644
index 7a6d6d8..0000000
--- a/.github/workflows/main.yml
+++ /dev/null
@@ -1,71 +0,0 @@
-name: build
-
-on:
-  push:
-    branches:
-      - master
-    paths-ignore:
-      - 'docs/**'
-      - '*.md'
-      - '*.rst'
-  pull_request:
-    branches:
-      - master
-    paths-ignore:
-      - 'docs/**'
-      - '*.md'
-      - '*.rst'
-jobs:
-  build:
-    runs-on: ${{ matrix.os }}
-    strategy:
-      fail-fast: false
-      matrix:
-        python: [3.7", "3.8", "3.9"]
-        os: [ubuntu-latest, macos-latest]
-        include:
-          - python: "3.7"
-            tox_env: "py37"
-          - python: "3.8"
-            tox_env: "py38"
-          - python: "3.9"
-            tox_env: "py39"
-          - python: "3.8"
-            tox_env: "pre"
-          - python: "3.8"
-            tox_env: "linting"
-    steps:
-    - uses: actions/checkout@v2
-    - name: Set up Python
-      uses: actions/setup-python@v2
-      with:
-        python-version: ${{ matrix.python }}
-    - name: Install tox
-      run: |
-        python -m pip install --upgrade pip
-        pip install tox
-    - name: Test
-      run: |
-        tox -e ${{ matrix.tox_env }}
-  deploy:
-    if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
-    runs-on: ubuntu-latest
-    needs: build
-    steps:
-    - uses: actions/checkout@v2
-    - name: Set up Python
-      uses: actions/setup-python@v2
-      with:
-        python-version: "3.8"
-    - name: Install wheel
-      run: |
-        python -m pip install --upgrade pip
-        pip install --upgrade wheel setuptools
-    - name: Build package
-      run: |
-        python setup.py sdist bdist_wheel
-    - name: Publish package to PyPI
-      uses: pypa/gh-action-pypi-publish@master
-      with:
-        user: __token__
-        password: ${{ secrets.pypi_token }}
diff --git a/.gitignore b/.gitignore
index a8e2994..566e4c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index aa5cd4c..8c4af08 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -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
diff --git a/HOWTORELEASE.rst b/HOWTORELEASE.rst
deleted file mode 100644
index 25bf2a7..0000000
--- a/HOWTORELEASE.rst
+++ /dev/null
@@ -1,29 +0,0 @@
-=======================
-Releasing pytest-flask
-=======================
-
-This document describes the steps to make a new ``pytest-flask`` release.
-
-Version
--------
-
-``master`` should always be green and a potential release candidate. ``pytest-flask`` follows
-semantic versioning, so given that the current version is ``X.Y.Z``, to find the next version number
-one needs to look at the ``docs/changelog.rst`` file.
-
-Steps
------
-
-#. Create a new branch named ``release-X.Y.Z`` from the latest ``master``.
-
-#. After making the necessary changes, commit and push the branch for review.
-
-#. Once PR is **green** and **approved**, create and push a tag::
-
-    $ export VERSION=X.Y.Z
-    $ git tag $VERSION release-$VERSION
-    $ git push git@github.com:pytest-dev/pytest-flask.git $VERSION
-
-    That will build the package and publish it on ``PyPI`` automatically.
-
-#. Merge ``release-X.Y.Z`` branch into master.
diff --git a/RELEASING.rst b/RELEASING.rst
new file mode 100644
index 0000000..8db6e7c
--- /dev/null
+++ b/RELEASING.rst
@@ -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.
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..242792b
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,6 @@
+[build-system]
+requires = [
+  "setuptools",
+  "setuptools-scm[toml]",
+]
+build-backend = "setuptools.build_meta"
diff --git a/requirements/main.txt b/requirements/main.txt
index f62409f..17ab14e 100644
--- a/requirements/main.txt
+++ b/requirements/main.txt
@@ -1,3 +1,3 @@
 pytest>=5.2
-Flask
+Flask <3.0
 Werkzeug>=0.7
diff --git a/setup.cfg b/setup.cfg
index 1d13009..85619b1 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -7,6 +7,7 @@ keywords = pytest, flask, testing
 author_email = vital.kudzelka@gmail.com
 url = https://github.com/pytest-dev/pytest-flask
 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
@@ -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
diff --git a/setup.py b/setup.py
index b73a107..7d3e067 100755
--- a/setup.py
+++ b/setup.py
@@ -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,
diff --git a/tox.ini b/tox.ini
index cd65a9c..1003554 100644
--- a/tox.ini
+++ b/tox.ini
@@ -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


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..7ddf9e5
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -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/build-and-inspect-python-package@v1.5
+
+  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`
diff --git a/pytest_flask/__init__.py b/src/pytest_flask/__init__.py
old mode 100755
new mode 100644
similarity index 100%
rename from pytest_flask/__init__.py
rename to src/pytest_flask/__init__.py
diff --git a/pytest_flask/_internal.py b/src/pytest_flask/_internal.py
similarity index 100%
rename from pytest_flask/_internal.py
rename to src/pytest_flask/_internal.py
diff --git a/pytest_flask/fixtures.py b/src/pytest_flask/fixtures.py
old mode 100755
new mode 100644
similarity index 98%
rename from pytest_flask/fixtures.py
rename to src/pytest_flask/fixtures.py
index d2a8cd4..45c94bf
--- a/pytest_flask/fixtures.py
+++ b/src/pytest_flask/fixtures.py
@@ -40,7 +40,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
diff --git a/pytest_flask/live_server.py b/src/pytest_flask/live_server.py
similarity index 98%
rename from pytest_flask/live_server.py
rename to src/pytest_flask/live_server.py
index 81dec51..d116406 100644
--- a/pytest_flask/live_server.py
+++ b/src/pytest_flask/live_server.py
@@ -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.
 
diff --git a/pytest_flask/plugin.py b/src/pytest_flask/plugin.py
old mode 100755
new mode 100644
similarity index 100%
rename from pytest_flask/plugin.py
rename to src/pytest_flask/plugin.py
diff --git a/pytest_flask/pytest_compat.py b/src/pytest_flask/pytest_compat.py
similarity index 100%
rename from pytest_flask/pytest_compat.py
rename to src/pytest_flask/pytest_compat.py