Skip to content

Commit

Permalink
feat: Enable support for 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
aucampia committed Dec 21, 2021
1 parent 6e2fa49 commit e46bc04
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 52 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Expand Up @@ -113,6 +113,7 @@
"**/.nox/**/*",
"samples/AUTHORING_GUIDE.md",
"samples/CONTRIBUTING.md",
"samples/snippets/README.md",
"samples/snippets/README.rst",
]

Expand Down
6 changes: 3 additions & 3 deletions noxfile.py
Expand Up @@ -30,8 +30,8 @@
DEFAULT_PYTHON_VERSION = "3.8"

# We're using two Python versions to test with sqlalchemy 1.3 and 1.4.
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.9"]
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10"]
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"]

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

Expand Down Expand Up @@ -100,7 +100,7 @@ def default(session):

if session.python == "3.8":
extras = "[tests,alembic]"
elif session.python == "3.9":
elif session.python in {"3.9", "3.10"}:
extras = "[tests,geography]"
else:
extras = "[tests]"
Expand Down
7 changes: 4 additions & 3 deletions owlbot.py
Expand Up @@ -31,10 +31,11 @@
extras_by_python = {
"3.8": ["tests", "alembic"],
"3.9": ["tests", "geography"],
"3.10": ["tests", "geography"],
}
templated_files = common.py_library(
unit_test_python_versions=["3.6", "3.7", "3.8", "3.9"],
system_test_python_versions=["3.8", "3.9"],
unit_test_python_versions=["3.6", "3.7", "3.8", "3.9", "3.10"],
system_test_python_versions=["3.8", "3.9", "3.10"],
cov_level=100,
unit_test_extras=extras,
unit_test_extras_by_python=extras_by_python,
Expand Down Expand Up @@ -136,7 +137,7 @@ def compliance(session):
)
if session.python == "3.8":
extras = "[tests,alembic]"
elif session.python == "3.9":
elif session.python in {"3.9", "3.10"}:
extras = "[tests,geography]"
else:
extras = "[tests]"
Expand Down
35 changes: 35 additions & 0 deletions samples/snippets/README.md
@@ -0,0 +1,35 @@
## Info regarding requirements{,-test}.{in,txt}

`requirements.in` is generated by running the following command in this
directory:

```bash
(cd ../../ \
&& python setup.py egg_info 1>&2 && \
cat sqlalchemy_bigquery.egg-info/requires.txt \
| egrep -v -e '^\[' -e '^\s*$') | tee requirements.in
```

This results in a requirements.in file that contains all direct dependencies of
this project with correct version ranges.

`requirements-test.in` is hand crtetafted.

`requirements.in` and `requirements-test.in` are made for processing with
[pip-compile](https://github.com/jazzband/pip-tools).

To generate `requirements{,-test}.txt` from `requirements{,-test}.in` run the
following commands in this directory:

```bash
pipx run --spec pip-tools --python python3.6 \
pip-compile --output-file=requirements.txt \
requirements.in
pipx run --spec pip-tools --python python3.6 \
pip-compile --output-file=requirements-test.txt \
requirements-test.in
```

**IMPORTANT**: python 3.6 is used as this is the lowest version of python
supported and if a newer version of python is used instead the
`requirements{,-test}.txt` will not work for python 3.6.
2 changes: 2 additions & 0 deletions samples/snippets/requirements-test.in
@@ -0,0 +1,2 @@
pytest
google-cloud-testutils
48 changes: 45 additions & 3 deletions samples/snippets/requirements-test.txt
@@ -1,12 +1,54 @@
#
# This file is autogenerated by pip-compile with python 3.6
# To update, run:
#
# pip-compile --output-file=requirements-test.txt requirements-test.in
#
attrs==21.2.0
google-cloud-testutils==1.2.0
importlib-metadata==4.8.1
# via pytest
cachetools==4.2.4
# via google-auth
click==8.0.3
# via google-cloud-testutils
google-auth==2.3.3
# via google-cloud-testutils
google-cloud-testutils==1.3.1
# via -r requirements-test.in
importlib-metadata==4.8.3
# via
# click
# pluggy
# pytest
iniconfig==1.1.1
# via pytest
packaging==21.0
# via
# google-cloud-testutils
# pytest
pluggy==1.0.0
# via pytest
py==1.10.0
# via pytest
pyasn1==0.4.8
# via
# pyasn1-modules
# rsa
pyasn1-modules==0.2.8
# via google-auth
pyparsing==3.0.2
# via packaging
pytest==6.2.5
# via -r requirements-test.in
rsa==4.8
# via google-auth
six==1.16.0
# via google-auth
toml==0.10.2
typing-extensions==3.10.0.2
# via pytest
typing-extensions==4.0.1
# via importlib-metadata
zipp==3.6.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# setuptools
15 changes: 15 additions & 0 deletions samples/snippets/requirements.in
@@ -0,0 +1,15 @@
google-api-core>=1.30.0
google-auth<3.0.0dev,>=1.25.0
google-cloud-bigquery<3.0.0dev,>=2.25.2
sqlalchemy<1.5.0dev,>=1.2.0
future
alembic
pytz
shapely
GeoAlchemy2
packaging
alembic
GeoAlchemy2
shapely
packaging
pytz
134 changes: 92 additions & 42 deletions samples/snippets/requirements.txt
@@ -1,66 +1,116 @@
aiocontextvars==0.2.2
attrs==21.2.0
#
# This file is autogenerated by pip-compile with python 3.6
# To update, run:
#
# pip-compile --output-file=requirements.txt requirements.in
#
alembic==1.7.5
# via -r requirements.in
cachetools==4.2.4
# via google-auth
certifi==2021.10.8
cffi==1.15.0
# via requests
charset-normalizer==2.0.7
click==8.0.3
click-plugins==1.1.1
cligj==0.7.2
contextvars==2.4
dataclasses==0.6; python_version < '3.7'
Deprecated==1.2.13
Fiona==1.8.20
# via requests
future==0.18.2
GeoAlchemy2==0.9.4
geopandas==0.9.0; python_version < '3.7'
geopandas==0.10.0; python_version >= '3.7'
google-api-core==2.2.0
# via -r requirements.in
geoalchemy2==0.9.4
# via -r requirements.in
google-api-core[grpc]==2.2.0
# via
# -r requirements.in
# google-cloud-bigquery
# google-cloud-core
google-auth==2.3.2
google-cloud-bigquery==2.28.1
google-cloud-bigquery-storage==2.9.1
# via
# -r requirements.in
# google-api-core
# google-cloud-core
google-cloud-bigquery==2.31.0
# via -r requirements.in
google-cloud-core==2.1.0
# via google-cloud-bigquery
google-crc32c==1.3.0
# via google-resumable-media
google-resumable-media==2.1.0
# via google-cloud-bigquery
googleapis-common-protos==1.53.0
# via
# google-api-core
# grpcio-status
greenlet==1.1.2
grpcio==1.41.1
# via sqlalchemy
grpcio==1.43.0
# via
# google-api-core
# google-cloud-bigquery
# grpcio-status
grpcio-status==1.43.0
# via google-api-core
idna==3.3
immutables==0.16
importlib-metadata==4.8.1
libcst==0.3.21
munch==2.5.0
mypy-extensions==0.4.3
numpy==1.19.5; python_version < '3.7'
numpy==1.21.2; python_version >= '3.7'
opentelemetry-api==1.6.2
opentelemetry-instrumentation==0.25b2
opentelemetry-sdk==1.6.2
opentelemetry-semantic-conventions==0.25b2
# via requests
importlib-metadata==4.8.3
# via
# alembic
# sqlalchemy
importlib-resources==5.4.0
# via alembic
mako==1.1.6
# via alembic
markupsafe==2.0.1
# via mako
packaging==21.0
pandas==1.1.5; python_version < '3.7'
pandas==1.3.2; python_version >= '3.7'
# via
# -r requirements.in
# geoalchemy2
# google-cloud-bigquery
proto-plus==1.19.7
# via google-cloud-bigquery
protobuf==3.19.0
pyarrow==6.0.0
# via
# google-api-core
# google-cloud-bigquery
# googleapis-common-protos
# grpcio-status
# proto-plus
pyasn1==0.4.8
# via
# pyasn1-modules
# rsa
pyasn1-modules==0.2.8
pycparser==2.20
# via google-auth
pyparsing==3.0.2
pyproj==3.0.1; python_version < '3.7'
pyproj==3.1.0; python_version >= '3.7'
# via packaging
python-dateutil==2.8.2
# via google-cloud-bigquery
pytz==2021.3
PyYAML==6.0
# via -r requirements.in
requests==2.26.0
# via
# google-api-core
# google-cloud-bigquery
rsa==4.7.2
Shapely==1.8.0
# via google-auth
shapely==1.8.0
# via -r requirements.in
six==1.16.0
SQLAlchemy==1.4.26
sqlalchemy-bigquery==1.2.1
tqdm==4.62.3
typing-extensions==3.10.0.2
typing-inspect==0.7.1
# via
# google-auth
# grpcio
# python-dateutil
sqlalchemy==1.4.26
# via
# -r requirements.in
# alembic
# geoalchemy2
typing-extensions==4.0.1
# via importlib-metadata
urllib3==1.26.7
wrapt==1.13.2
# via requests
zipp==3.6.0
# via
# importlib-metadata
# importlib-resources

# The following packages are considered to be unsafe in a requirements file:
# setuptools
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -73,6 +73,7 @@ def readme():
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Operating System :: OS Independent",
"Topic :: Database :: Front-Ends",
],
Expand All @@ -88,7 +89,7 @@ def readme():
"future",
],
extras_require=extras,
python_requires=">=3.6, <3.10",
python_requires=">=3.6, <3.11",
tests_require=["packaging", "pytz"],
entry_points={
"sqlalchemy.dialects": ["bigquery = sqlalchemy_bigquery:BigQueryDialect"]
Expand Down

0 comments on commit e46bc04

Please sign in to comment.