Skip to content

Commit 31d91d6

Browse files
authored
Removing Python 2 support (#381)
1 parent 81463e2 commit 31d91d6

File tree

7 files changed

+8
-93
lines changed

7 files changed

+8
-93
lines changed

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
language: python
22
python:
3-
- "2.7"
43
- "3.4"
54
- "3.5"
65
- "3.6"
6+
- "3.7"
77
- "pypy3.5"
88

99
jobs:

Diff for: CONTRIBUTING.md

+1-48
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ information on using pull requests.
8585

8686
### Initial Setup
8787

88-
You need Python 2.7 or Python 3.4+ to build and test the code in this repo.
88+
You need Python 3.4+ to build and test the code in this repo.
8989

9090
We recommend using [pip](https://pypi.python.org/pypi/pip) for installing the necessary tools and
9191
project dependencies. Most recent versions of Python ship with pip. If your development environment
@@ -227,53 +227,6 @@ pytest --cov --cov-report html
227227
and point your browser to
228228
`file:///<dir>/htmlcov/index.html` (where `dir` is the location from which the report was created).
229229

230-
231-
### Testing in Different Environments
232-
233-
Sometimes we want to run unit tests in multiple environments (e.g. different Python versions), and
234-
ensure that the SDK works as expected in each of them. We use
235-
[tox](https://tox.readthedocs.io/en/latest/) for this purpose.
236-
237-
But before you can invoke tox, you must set up all the necessary target environments on your
238-
workstation. The easiest and cleanest way to achieve this is by using a tool like
239-
[pyenv](https://github.com/pyenv/pyenv). Refer to the
240-
[pyenv documentation](https://github.com/pyenv/pyenv#installation) for instructions on how to
241-
install it. This generally involves installing some binaries as well as modifying a system level
242-
configuration file such as `.bash_profile`. Once pyenv is installed, you can install multiple
243-
versions of Python as follows:
244-
245-
```
246-
pyenv install 2.7.6 # install Python 2.7.6
247-
pyenv install 3.3.0 # install Python 3.3.0
248-
pyenv install pypy2-5.6.0 # install pypy2
249-
```
250-
251-
Refer to the [`tox.ini`](tox.ini) file for a list of target environments that we usually test.
252-
Use pyenv to install all the required Python versions on your workstation. Verify that they are
253-
installed by running the following command:
254-
255-
```
256-
pyenv versions
257-
```
258-
259-
To make all the required Python versions available to tox for testing, run the `pyenv local` command
260-
with all the Python versions as arguments. The following example shows how to make Python versions
261-
2.7.6, 3.3.0 and pypy2 available to tox.
262-
263-
```
264-
pyenv local 2.7.6 3.3.0 pypy2-5.6.0
265-
```
266-
267-
Once your system is fully set up, you can execute the following command from the root of the
268-
repository to launch tox:
269-
270-
```
271-
tox
272-
```
273-
274-
This command will read the list of target environments from `tox.ini`, and execute tests in each of
275-
those environments. It will also generate a code coverage report at the end of the execution.
276-
277230
### Repo Organization
278231

279232
Here are some highlights of the directory structure and notable source files

Diff for: README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ requests, code review feedback, and also pull requests.
4141

4242
## Supported Python Versions
4343

44-
We currently support Python 2.7 and Python 3.4+. However, Python 2.7 support is
45-
being phased out, and the developers are advised to use latest Python 3.
46-
Firebase Admin Python SDK is also tested on PyPy and
47-
[Google App Engine](https://cloud.google.com/appengine/) environments.
44+
We currently support Python 3.4+. Firebase Admin Python SDK is also tested on
45+
PyPy and [Google App Engine](https://cloud.google.com/appengine/) environments.
4846

4947

5048
## Documentation

Diff for: requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ pylint == 1.6.4
22
pytest >= 3.6.0
33
pytest-cov >= 2.4.0
44
pytest-localserver >= 0.4.1
5-
tox >= 3.6.0
65

76
cachecontrol >= 0.12.6
87
google-api-core[grpc] >= 1.14.0, < 2.0.0dev; platform.python_implementation != 'PyPy'

Diff for: scripts/prepare_release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fi
132132
##################
133133

134134
echo "[INFO] Running unit tests"
135-
tox
135+
pytest ../tests
136136

137137
echo "[INFO] Running integration tests"
138138
pytest ../integration --cert cert.json --apikey apikey.txt

Diff for: setup.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323

2424
(major, minor) = (sys.version_info.major, sys.version_info.minor)
25-
if (major == 2 and minor < 7) or (major == 3 and minor < 4):
26-
print('firebase_admin requires python2 >= 2.7 or python3 >= 3.4', file=sys.stderr)
25+
if major != 3 or minor < 4:
26+
print('firebase_admin requires python >= 3.4', file=sys.stderr)
2727
sys.exit(1)
2828

2929
# Read in the package metadata per recommendations from:
@@ -56,13 +56,11 @@
5656
keywords='firebase cloud development',
5757
install_requires=install_requires,
5858
packages=['firebase_admin'],
59-
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
59+
python_requires='>=3.4',
6060
classifiers=[
6161
'Development Status :: 5 - Production/Stable',
6262
'Intended Audience :: Developers',
6363
'Topic :: Software Development :: Build Tools',
64-
'Programming Language :: Python :: 2',
65-
'Programming Language :: Python :: 2.7',
6664
'Programming Language :: Python :: 3',
6765
'Programming Language :: Python :: 3.4',
6866
'Programming Language :: Python :: 3.5',

Diff for: tox.ini

-33
This file was deleted.

0 commit comments

Comments
 (0)