Skip to content

change: Removed Python 2 support #381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "pypy3.5"

jobs:
49 changes: 1 addition & 48 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -85,7 +85,7 @@ information on using pull requests.

### Initial Setup

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

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


### Testing in Different Environments

Sometimes we want to run unit tests in multiple environments (e.g. different Python versions), and
ensure that the SDK works as expected in each of them. We use
[tox](https://tox.readthedocs.io/en/latest/) for this purpose.

But before you can invoke tox, you must set up all the necessary target environments on your
workstation. The easiest and cleanest way to achieve this is by using a tool like
[pyenv](https://github.com/pyenv/pyenv). Refer to the
[pyenv documentation](https://github.com/pyenv/pyenv#installation) for instructions on how to
install it. This generally involves installing some binaries as well as modifying a system level
configuration file such as `.bash_profile`. Once pyenv is installed, you can install multiple
versions of Python as follows:

```
pyenv install 2.7.6 # install Python 2.7.6
pyenv install 3.3.0 # install Python 3.3.0
pyenv install pypy2-5.6.0 # install pypy2
```

Refer to the [`tox.ini`](tox.ini) file for a list of target environments that we usually test.
Use pyenv to install all the required Python versions on your workstation. Verify that they are
installed by running the following command:

```
pyenv versions
```

To make all the required Python versions available to tox for testing, run the `pyenv local` command
with all the Python versions as arguments. The following example shows how to make Python versions
2.7.6, 3.3.0 and pypy2 available to tox.

```
pyenv local 2.7.6 3.3.0 pypy2-5.6.0
```

Once your system is fully set up, you can execute the following command from the root of the
repository to launch tox:

```
tox
```

This command will read the list of target environments from `tox.ini`, and execute tests in each of
those environments. It will also generate a code coverage report at the end of the execution.

### Repo Organization

Here are some highlights of the directory structure and notable source files
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -41,10 +41,8 @@ requests, code review feedback, and also pull requests.

## Supported Python Versions

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


## Documentation
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@ pylint == 1.6.4
pytest >= 3.6.0
pytest-cov >= 2.4.0
pytest-localserver >= 0.4.1
tox >= 3.6.0

cachecontrol >= 0.12.6
google-api-core[grpc] >= 1.14.0, < 2.0.0dev; platform.python_implementation != 'PyPy'
2 changes: 1 addition & 1 deletion scripts/prepare_release.sh
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@ fi
##################

echo "[INFO] Running unit tests"
tox
pytest ../tests

echo "[INFO] Running integration tests"
pytest ../integration --cert cert.json --apikey apikey.txt
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -22,8 +22,8 @@


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

# Read in the package metadata per recommendations from:
@@ -56,13 +56,11 @@
keywords='firebase cloud development',
install_requires=install_requires,
packages=['firebase_admin'],
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
python_requires='>=3.4',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
33 changes: 0 additions & 33 deletions tox.ini

This file was deleted.