Skip to content

Commit 2c5ee89

Browse files
authored
Merge pull request #1026 from jmchilton/drop_python_2
Drop Python 2 Support
2 parents 9c0ec82 + 1823603 commit 2c5ee89

File tree

6 files changed

+21
-32
lines changed

6 files changed

+21
-32
lines changed

CONTRIBUTING.rst

+16-14
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Before you submit a pull request, check that it meets these guidelines:
106106

107107
1. If the pull request adds functionality, the docs should be updated. Put
108108
your new functionality into a function with a docstring.
109-
2. The pull request should work for Python 2.7 and >=3.5. Check
109+
2. The pull request should work for Python >=3.5. Check
110110
https://travis-ci.org/galaxyproject/planemo/pull_requests
111111
and make sure that the tests pass for all supported Python versions.
112112

@@ -118,7 +118,7 @@ To run a subset of tests::
118118
% make tox ENV=py37-unit ARGS='--tests tests/test_shed_upload.py'
119119

120120
This will use Tox_ to run the specified tests using Python 3.7. ``ENV`` here
121-
can be used to specify different Python version (e.g. ``py27`` and
121+
can be used to specify different Python version (e.g. ``py35`` or
122122
``py37``).
123123

124124
Even more granularity is also possible by specifying specific test methods.::
@@ -138,7 +138,7 @@ Tox_ itself is configured to wrap nose_. One can skip Tox_ and run
138138

139139
::
140140

141-
nosetests tests/test_shed_upload.py
141+
pytest tests/test_shed_upload.py
142142

143143
Tox_
144144
~~~~~~~~~~~
@@ -147,22 +147,24 @@ Tox_ is a tool to automate testing across different Python versions. The
147147
``tox`` executable can be supplied with a ``-e`` argument to specify a
148148
testing environment. Planemo defines the following environments:
149149

150-
``py27-lint``
151-
Lint the planemo code using Python 2.7.
152-
153150
``py37-lint``
154-
Lint the planemo code using Python 3.7 (also ensures valid Python 3
155-
syntax).
151+
Lint the planemo code using Python 3.7..
152+
153+
``py37-lint_docs``
154+
Lint the docs reStructuredText.
156155

157-
``py37-lint_readme``
158-
Lint the README reStructuredText.
156+
``py37-lint_docstrings``
157+
Lint the project Python docstrings (doesn't pass currently).
159158

160-
``py27-unit``
161-
Run planemo tests in Python 2.7.
159+
``py35-unit-quick``
160+
Run the fastest unit tests (with least external dependencies) on Python 3.5.
162161

163-
``py37-unit``
164-
Run planemo tests in Python 3.7.
162+
``py36-unit-nonredundant-noclientbuild-gx-2005``
163+
Run tests that are marked as targeting a Galaxy branch and test against Galaxy 20.05.
164+
Skip tests that are marked as redundant or that require a Galaxy client build.
165165

166+
``py37-unit-gx-dev``
167+
Run tests that are marked as targeting a Galaxy branch and test against Galaxy's dev branch.
166168

167169
Pre-commit Hooks
168170
~~~~~~~~~~~~~~~~~~~~~

planemo/options.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def galaxy_python_version():
159159
'--galaxy_python_version',
160160
use_global_config=True,
161161
default=None,
162-
type=click.Choice(['2', '2.7', '3', '3.5', '3.6', '3.7', '3.8']),
162+
type=click.Choice(['3', '3.5', '3.6', '3.7', '3.8']),
163163
help="Python version to start Galaxy under",
164164
)
165165

requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ cwltool==1.0.20191225192155
77
docutils
88
ephemeris>=0.10.3
99
galaxy-containers
10-
galaxy-tool-util>=20.5.0.dev1
11-
galaxy-util>=20.1.0.dev0 # temporarily needed because this is a pre-release and https://github.com/pypa/pip/issues/988
10+
galaxy-tool-util>=20.5.0
11+
galaxy-util>=20.5.0
1212
glob2
1313
gxformat2>=0.8.0
1414
jinja2

setup.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
except ImportError:
1111
from distutils.core import setup
1212

13-
if sys.version_info < (2, 7):
14-
sys.stderr.write("ERROR: planemo requires at least Python Version 2.7\n")
13+
if sys.version_info < (3, 5):
14+
sys.stderr.write("ERROR: planemo requires at least Python Version 3.5\n")
1515
sys.exit(1)
1616

1717
# Allow installer to turn off dependency on lxml by setting the environment variable
@@ -91,14 +91,11 @@ def get_var(var_name):
9191
if os.path.exists("requirements.txt"):
9292
with open("requirements.txt") as fh:
9393
requirements = [r for r in fh.read().split("\n") if ";" not in r]
94-
with open("requirements.txt") as fh:
95-
py27_requirements = [r.split(";", 1)[0].strip() for r in fh.read().split("\n") if ";" in r]
9694
if not PLANEMO_REQUIRE_LXML:
9795
requirements.remove("lxml")
9896
else:
9997
# In tox, it will cover them anyway.
10098
requirements = []
101-
py27_requirements = []
10299

103100
test_requirements = [
104101
# TODO: put package test requirements here
@@ -120,9 +117,6 @@ def get_var(var_name):
120117
package_dir=PACKAGE_DIR,
121118
include_package_data=True,
122119
install_requires=requirements,
123-
extras_require={
124-
':python_version=="2.7"': py27_requirements,
125-
},
126120
license="AFL",
127121
zip_safe=False,
128122
keywords='planemo',
@@ -136,8 +130,6 @@ def get_var(var_name):
136130
'Topic :: Software Development :: Code Generators',
137131
'Topic :: Software Development :: Testing',
138132
'Natural Language :: English',
139-
"Programming Language :: Python :: 2",
140-
'Programming Language :: Python :: 2.7',
141133
"Programming Language :: Python :: 3",
142134
'Programming Language :: Python :: 3.5',
143135
'Programming Language :: Python :: 3.6',

tests/test_cmd_serve.py

-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def setUp(self):
4545
self._serve_artifact = os.path.join(TEST_REPOS_DIR, "single_tool", "cat.xml")
4646

4747
@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
48-
@skip_if_environ("PLANEMO_SKIP_PYTHON2")
4948
@mark.tests_galaxy_branch
5049
def test_serve(self):
5150
extra_args = [
@@ -54,7 +53,6 @@ def test_serve(self):
5453
self._launch_thread_and_wait(self._run, extra_args)
5554

5655
@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")
57-
@skip_if_environ("PLANEMO_SKIP_PYTHON3")
5856
@skip_if_environ("PLANEMO_SKIP_GALAXY_CLIENT_TESTS")
5957
@skip_unless_executable("python3")
6058
def test_serve_client_python3(self):

tox.ini

-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ setenv =
4545
noshed: PLANEMO_SKIP_SHED_TESTS=1
4646
quick: PLANEMO_SKIP_SLOW_TESTS=1
4747
quick: PLANEMO_SKIP_GALAXY_TESTS=1
48-
py27-unit: PLANEMO_SKIP_PYTHON3=1
49-
!py27-unit: PLANEMO_SKIP_PYTHON2=1
50-
!py27-unit: PLANEMO_DEFAULT_PYTHON_VERSION=3
5148
master: PLANEMO_TEST_GALAXY_BRANCH=master
5249
dev: PLANEMO_TEST_GALAXY_BRANCH=dev
5350
2005: PLANEMO_TEST_GALAXY_BRANCH=release_20.05

0 commit comments

Comments
 (0)