forked from orbit-oss/flask
drop support for Python 2.7 and 3.5
This commit is contained in:
parent
7673835b3d
commit
a0a61acdec
7 changed files with 53 additions and 129 deletions
|
|
@ -1,85 +1,44 @@
|
||||||
trigger:
|
trigger:
|
||||||
- 'master'
|
- master
|
||||||
- '*.x'
|
- '*.x'
|
||||||
|
|
||||||
jobs:
|
variables:
|
||||||
- job: Tests
|
vmImage: ubuntu-latest
|
||||||
variables:
|
python.version: '3.8'
|
||||||
vmImage: 'ubuntu-latest'
|
TOXENV: py
|
||||||
python.version: '3.8'
|
|
||||||
TOXENV: 'py,coverage-ci'
|
|
||||||
hasTestResults: 'true'
|
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
Python 3.8 Linux:
|
Linux:
|
||||||
vmImage: 'ubuntu-latest'
|
|
||||||
Python 3.8 Windows:
|
|
||||||
vmImage: 'windows-latest'
|
|
||||||
Python 3.8 Mac:
|
|
||||||
vmImage: 'macos-latest'
|
|
||||||
PyPy 3 Linux:
|
|
||||||
python.version: 'pypy3'
|
|
||||||
Python 3.7 Linux:
|
|
||||||
python.version: '3.7'
|
|
||||||
Python 3.6 Linux:
|
|
||||||
python.version: '3.6'
|
|
||||||
Python 3.5 Linux:
|
|
||||||
python.version: '3.5'
|
|
||||||
Python 2.7 Linux:
|
|
||||||
python.version: '2.7'
|
|
||||||
Python 2.7 Windows:
|
|
||||||
python.version: '2.7'
|
|
||||||
vmImage: 'windows-latest'
|
|
||||||
Docs:
|
|
||||||
TOXENV: 'docs'
|
|
||||||
hasTestResults: 'false'
|
|
||||||
Style:
|
|
||||||
TOXENV: 'style'
|
|
||||||
hasTestResults: 'false'
|
|
||||||
VersionRange:
|
|
||||||
TOXENV: 'devel,lowest,coverage-ci'
|
|
||||||
|
|
||||||
pool:
|
|
||||||
vmImage: $[ variables.vmImage ]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- task: UsePythonVersion@0
|
|
||||||
inputs:
|
|
||||||
versionSpec: $(python.version)
|
|
||||||
displayName: Use Python $(python.version)
|
|
||||||
|
|
||||||
- script: pip --disable-pip-version-check install -U tox
|
|
||||||
displayName: Install tox
|
|
||||||
|
|
||||||
- script: tox -s false -- --junitxml=test-results.xml tests examples
|
|
||||||
displayName: Run tox
|
|
||||||
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
inputs:
|
|
||||||
testResultsFiles: test-results.xml
|
|
||||||
testRunTitle: $(Agent.JobName)
|
|
||||||
condition: eq(variables['hasTestResults'], 'true')
|
|
||||||
displayName: Publish test results
|
|
||||||
|
|
||||||
- task: PublishCodeCoverageResults@1
|
|
||||||
inputs:
|
|
||||||
codeCoverageTool: Cobertura
|
|
||||||
summaryFileLocation: coverage.xml
|
|
||||||
condition: eq(variables['hasTestResults'], 'true')
|
|
||||||
displayName: Publish coverage results
|
|
||||||
|
|
||||||
# Test on the nightly version of Python.
|
|
||||||
# Use a container since Azure Pipelines may not have the latest build.
|
|
||||||
- job: FlaskOnNightly
|
|
||||||
pool:
|
|
||||||
vmImage: ubuntu-latest
|
vmImage: ubuntu-latest
|
||||||
container: python:rc-stretch
|
Windows:
|
||||||
steps:
|
vmImage: windows-latest
|
||||||
- script: |
|
Mac:
|
||||||
echo "##vso[task.prependPath]$HOME/.local/bin"
|
vmImage: macos-latest
|
||||||
pip --disable-pip-version-check install --user -U tox
|
Python 3.7:
|
||||||
displayName: Install tox
|
python.version: '3.7'
|
||||||
|
Python 3.6:
|
||||||
|
python.version: '3.6'
|
||||||
|
PyPy 3:
|
||||||
|
python.version: pypy3
|
||||||
|
Version Range:
|
||||||
|
TOXENV: 'devel,lowest'
|
||||||
|
Docs:
|
||||||
|
TOXENV: docs
|
||||||
|
Style:
|
||||||
|
TOXENV: style
|
||||||
|
|
||||||
- script: tox -e nightly
|
pool:
|
||||||
displayName: Run tox
|
vmImage: $[ variables.vmImage ]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- task: UsePythonVersion@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: $(python.version)
|
||||||
|
displayName: Use Python $(python.version)
|
||||||
|
|
||||||
|
- script: pip --disable-pip-version-check install -U tox
|
||||||
|
displayName: Install tox
|
||||||
|
|
||||||
|
- script: tox
|
||||||
|
displayName: Run tox
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
.. currentmodule:: flask
|
.. currentmodule:: flask
|
||||||
|
|
||||||
Version 1.2.0
|
Version 2.0.0
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
Unreleased
|
Unreleased
|
||||||
|
|
||||||
|
- Drop support for Python 2 and 3.5.
|
||||||
- Add :meth:`sessions.SessionInterface.get_cookie_name` to allow
|
- Add :meth:`sessions.SessionInterface.get_cookie_name` to allow
|
||||||
setting the session cookie name dynamically. :pr:`3369`
|
setting the session cookie name dynamically. :pr:`3369`
|
||||||
- Add :meth:`Config.from_file` to load config using arbitrary file
|
- Add :meth:`Config.from_file` to load config using arbitrary file
|
||||||
|
|
|
||||||
10
setup.cfg
10
setup.cfg
|
|
@ -1,8 +1,7 @@
|
||||||
[bdist_wheel]
|
|
||||||
universal = true
|
|
||||||
|
|
||||||
[tool:pytest]
|
[tool:pytest]
|
||||||
testpaths = tests
|
testpaths = tests
|
||||||
|
filterwarnings =
|
||||||
|
error
|
||||||
|
|
||||||
[coverage:run]
|
[coverage:run]
|
||||||
branch = True
|
branch = True
|
||||||
|
|
@ -12,9 +11,8 @@ source =
|
||||||
|
|
||||||
[coverage:paths]
|
[coverage:paths]
|
||||||
source =
|
source =
|
||||||
src/flask
|
src
|
||||||
.tox/*/lib/python*/site-packages/flask
|
*/site-packages
|
||||||
.tox/*/site-packages/flask
|
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
# B = bugbear
|
# B = bugbear
|
||||||
|
|
|
||||||
11
setup.py
11
setup.py
|
|
@ -34,15 +34,6 @@ setup(
|
||||||
"License :: OSI Approved :: BSD License",
|
"License :: OSI Approved :: BSD License",
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
"Programming Language :: Python",
|
"Programming Language :: Python",
|
||||||
"Programming Language :: Python :: 2",
|
|
||||||
"Programming Language :: Python :: 2.7",
|
|
||||||
"Programming Language :: Python :: 3",
|
|
||||||
"Programming Language :: Python :: 3.5",
|
|
||||||
"Programming Language :: Python :: 3.6",
|
|
||||||
"Programming Language :: Python :: 3.7",
|
|
||||||
"Programming Language :: Python :: 3.8",
|
|
||||||
"Programming Language :: Python :: Implementation :: CPython",
|
|
||||||
"Programming Language :: Python :: Implementation :: PyPy",
|
|
||||||
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
|
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
|
||||||
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
|
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
|
||||||
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
||||||
|
|
@ -51,7 +42,7 @@ setup(
|
||||||
packages=find_packages("src"),
|
packages=find_packages("src"),
|
||||||
package_dir={"": "src"},
|
package_dir={"": "src"},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
|
python_requires=">=3.6",
|
||||||
install_requires=[
|
install_requires=[
|
||||||
"Werkzeug>=0.15",
|
"Werkzeug>=0.15",
|
||||||
"Jinja2>=2.10.1",
|
"Jinja2>=2.10.1",
|
||||||
|
|
|
||||||
|
|
@ -57,4 +57,4 @@ from .signals import template_rendered
|
||||||
from .templating import render_template
|
from .templating import render_template
|
||||||
from .templating import render_template_string
|
from .templating import render_template_string
|
||||||
|
|
||||||
__version__ = "1.2.0.dev"
|
__version__ = "2.0.0.dev"
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ def test_explicit_instance_paths(modules_tmpdir):
|
||||||
assert app.instance_path == str(modules_tmpdir)
|
assert app.instance_path == str(modules_tmpdir)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail(reason="TODO: weird interaction with tox")
|
@pytest.mark.xfail(reason="weird interaction with tox")
|
||||||
def test_main_module_paths(modules_tmpdir, purge_module):
|
def test_main_module_paths(modules_tmpdir, purge_module):
|
||||||
app = modules_tmpdir.join("main_app.py")
|
app = modules_tmpdir.join("main_app.py")
|
||||||
app.write('import flask\n\napp = flask.Flask("__main__")')
|
app.write('import flask\n\napp = flask.Flask("__main__")')
|
||||||
|
|
@ -36,6 +36,7 @@ def test_main_module_paths(modules_tmpdir, purge_module):
|
||||||
assert app.instance_path == os.path.join(here, "instance")
|
assert app.instance_path == os.path.join(here, "instance")
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.xfail(reason="weird interaction with tox")
|
||||||
def test_uninstalled_module_paths(modules_tmpdir, purge_module):
|
def test_uninstalled_module_paths(modules_tmpdir, purge_module):
|
||||||
app = modules_tmpdir.join("config_module_app.py").write(
|
app = modules_tmpdir.join("config_module_app.py").write(
|
||||||
"import os\n"
|
"import os\n"
|
||||||
|
|
@ -50,6 +51,7 @@ def test_uninstalled_module_paths(modules_tmpdir, purge_module):
|
||||||
assert app.instance_path == str(modules_tmpdir.join("instance"))
|
assert app.instance_path == str(modules_tmpdir.join("instance"))
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.xfail(reason="weird interaction with tox")
|
||||||
def test_uninstalled_package_paths(modules_tmpdir, purge_module):
|
def test_uninstalled_package_paths(modules_tmpdir, purge_module):
|
||||||
app = modules_tmpdir.mkdir("config_package_app")
|
app = modules_tmpdir.mkdir("config_package_app")
|
||||||
init = app.join("__init__.py")
|
init = app.join("__init__.py")
|
||||||
|
|
|
||||||
35
tox.ini
35
tox.ini
|
|
@ -1,16 +1,14 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist =
|
envlist =
|
||||||
py{38,37,36,35,27,py3,py}
|
py{38,37,36,py3}
|
||||||
py38-{simplejson,devel,lowest}
|
py38-{simplejson,devel,lowest}
|
||||||
|
style
|
||||||
docs
|
docs
|
||||||
coverage
|
|
||||||
skip_missing_interpreters = true
|
skip_missing_interpreters = true
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
passenv = LANG
|
|
||||||
deps =
|
deps =
|
||||||
pytest
|
pytest
|
||||||
coverage
|
|
||||||
greenlet
|
greenlet
|
||||||
blinker
|
blinker
|
||||||
python-dotenv
|
python-dotenv
|
||||||
|
|
@ -29,18 +27,10 @@ deps =
|
||||||
simplejson: simplejson
|
simplejson: simplejson
|
||||||
|
|
||||||
commands =
|
commands =
|
||||||
# the examples need to be installed to test successfully
|
|
||||||
pip install -q -e examples/tutorial[test]
|
pip install -q -e examples/tutorial[test]
|
||||||
pip install -q -e examples/javascript[test]
|
pip install -q -e examples/javascript[test]
|
||||||
|
|
||||||
# pytest-cov doesn't seem to play nice with -p
|
pytest --tb=short --basetemp={envtmpdir} {posargs:tests examples}
|
||||||
coverage run -p -m pytest --tb=short -Werror {posargs:tests examples}
|
|
||||||
|
|
||||||
[testenv:nightly]
|
|
||||||
# courtesy Python nightly test, don't fail the build in CI
|
|
||||||
ignore_outcome = true
|
|
||||||
commands =
|
|
||||||
coverage run -p -m pytest --tb=short -Werror --junitxml=test-results.xml tests
|
|
||||||
|
|
||||||
[testenv:style]
|
[testenv:style]
|
||||||
deps = pre-commit
|
deps = pre-commit
|
||||||
|
|
@ -48,22 +38,5 @@ skip_install = true
|
||||||
commands = pre-commit run --all-files --show-diff-on-failure
|
commands = pre-commit run --all-files --show-diff-on-failure
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
deps =
|
deps = -r docs/requirements.txt
|
||||||
-r docs/requirements.txt
|
|
||||||
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html
|
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html
|
||||||
|
|
||||||
[testenv:coverage]
|
|
||||||
deps = coverage
|
|
||||||
skip_install = true
|
|
||||||
commands =
|
|
||||||
coverage combine
|
|
||||||
coverage html
|
|
||||||
coverage report
|
|
||||||
|
|
||||||
[testenv:coverage-ci]
|
|
||||||
deps = coverage
|
|
||||||
skip_install = true
|
|
||||||
commands =
|
|
||||||
coverage combine
|
|
||||||
coverage xml
|
|
||||||
coverage report
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue