-
- As of January 1, 2020 this library no longer supports Python 2 on the latest released version. +
+ As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.
diff --git a/docs/conf.py b/docs/conf.py index e9c68d4..9482b97 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -156,7 +156,7 @@ html_theme_options = { "description": "Google Cloud Client Libraries for db-dtypes", "github_user": "googleapis", - "github_repo": "python-bigquery-sqlalchemy", + "github_repo": "python-db-dtypes-pandas", "github_banner": True, "font_family": "'Roboto', Georgia, sans", "head_font_family": "'Roboto', Georgia, serif", @@ -351,6 +351,7 @@ "grpc": ("https://grpc.github.io/grpc/python/", None), "proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None), "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), + "pandas": ("http://pandas.pydata.org/pandas-docs/dev", None), } diff --git a/noxfile.py b/noxfile.py index 1e88b21..63ac434 100644 --- a/noxfile.py +++ b/noxfile.py @@ -28,9 +28,7 @@ BLACK_PATHS = ["docs", "db_dtypes", "tests", "noxfile.py", "setup.py"] 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"] +SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -40,8 +38,6 @@ "lint", "unit", "cover", - "system", - "compliance", "lint_setup_py", "blacken", "docs", @@ -98,13 +94,7 @@ def default(session): constraints_path, ) - if session.python == "3.8": - extras = "[tests,alembic]" - elif session.python == "3.9": - extras = "[tests,geography]" - else: - extras = "[tests]" - session.install("-e", f".{extras}", "-c", constraints_path) + session.install("-e", ".", "-c", constraints_path) # Run py.test against the unit tests. session.run( @@ -156,13 +146,7 @@ def system(session): # Install all test dependencies, then install this package into the # virtualenv's dist-packages. session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path) - if session.python == "3.8": - extras = "[tests,alembic]" - elif session.python == "3.9": - extras = "[tests,geography]" - else: - extras = "[tests]" - session.install("-e", f".{extras}", "-c", constraints_path) + session.install("-e", ".", "-c", constraints_path) # Run py.test against the system tests. if system_test_exists: @@ -183,56 +167,6 @@ def system(session): ) -@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) -def compliance(session): - """Run the SQLAlchemy dialect-compliance system tests""" - constraints_path = str( - CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" - ) - system_test_folder_path = os.path.join("tests", "sqlalchemy_dialect_compliance") - - if os.environ.get("RUN_COMPLIANCE_TESTS", "true") == "false": - session.skip("RUN_COMPLIANCE_TESTS is set to false, skipping") - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true": - session.install("pyopenssl") - if not os.path.exists(system_test_folder_path): - session.skip("Compliance tests were not found") - - session.install("--pre", "grpcio") - - session.install( - "mock", - "pytest", - "pytest-rerunfailures", - "google-cloud-testutils", - "-c", - constraints_path, - ) - if session.python == "3.8": - extras = "[tests,alembic]" - elif session.python == "3.9": - extras = "[tests,geography]" - else: - extras = "[tests]" - session.install("-e", f".{extras}", "-c", constraints_path) - - session.run( - "py.test", - "-vv", - f"--junitxml=compliance_{session.python}_sponge_log.xml", - "--reruns=3", - "--reruns-delay=60", - "--only-rerun=403 Exceeded rate limits", - "--only-rerun=409 Already Exists", - "--only-rerun=404 Not found", - "--only-rerun=400 Cannot execute DML over a non-existent table", - system_test_folder_path, - *session.posargs, - ) - - @nox.session(python=DEFAULT_PYTHON_VERSION) def cover(session): """Run the final coverage report. @@ -251,9 +185,7 @@ def docs(session): """Build the docs for this library.""" session.install("-e", ".") - session.install( - "sphinx==4.0.1", "alabaster", "geoalchemy2", "shapely", "recommonmark" - ) + session.install("sphinx==4.0.1", "alabaster", "recommonmark") shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( @@ -276,12 +208,7 @@ def docfx(session): session.install("-e", ".") session.install( - "sphinx==4.0.1", - "alabaster", - "geoalchemy2", - "shapely", - "recommonmark", - "gcp-sphinx-docfx-yaml", + "sphinx==4.0.1", "alabaster", "recommonmark", "gcp-sphinx-docfx-yaml" ) shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) diff --git a/owlbot.py b/owlbot.py index 5acefc9..dd1ed69 100644 --- a/owlbot.py +++ b/owlbot.py @@ -31,6 +31,7 @@ unit_test_python_versions=["3.6", "3.7", "3.8", "3.9"], system_test_python_versions=["3.8"], cov_level=100, + intersphinx_dependencies={"pandas": "http://pandas.pydata.org/pandas-docs/dev"}, ) s.move(templated_files, excludes=["docs/multiprocessing.rst"]) @@ -65,6 +66,7 @@ def place_before(path, text, *before_text, escape=None): "nox.options.stop_on_first_error = True", ) +# There are no system tests for this package. old_sessions = """ "unit", "system", @@ -76,8 +78,6 @@ def place_before(path, text, *before_text, escape=None): "lint", "unit", "cover", - "system", - "compliance", """ s.replace(["noxfile.py"], old_sessions, new_sessions) diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py index d0cc158..d309d6e 100644 --- a/scripts/readme-gen/readme_gen.py +++ b/scripts/readme-gen/readme_gen.py @@ -28,21 +28,19 @@ jinja_env = jinja2.Environment( trim_blocks=True, loader=jinja2.FileSystemLoader( - os.path.abspath(os.path.join(os.path.dirname(__file__), "templates")) - ), -) + os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) -README_TMPL = jinja_env.get_template("README.tmpl.rst") +README_TMPL = jinja_env.get_template('README.tmpl.rst') def get_help(file): - return subprocess.check_output(["python", file, "--help"]).decode() + return subprocess.check_output(['python', file, '--help']).decode() def main(): parser = argparse.ArgumentParser() - parser.add_argument("source") - parser.add_argument("--destination", default="README.rst") + parser.add_argument('source') + parser.add_argument('--destination', default='README.rst') args = parser.parse_args() @@ -50,9 +48,9 @@ def main(): root = os.path.dirname(source) destination = os.path.join(root, args.destination) - jinja_env.globals["get_help"] = get_help + jinja_env.globals['get_help'] = get_help - with io.open(source, "r") as f: + with io.open(source, 'r') as f: config = yaml.load(f) # This allows get_help to execute in the right directory. @@ -60,9 +58,9 @@ def main(): output = README_TMPL.render(config) - with io.open(destination, "w") as f: + with io.open(destination, 'w') as f: f.write(output) -if __name__ == "__main__": +if __name__ == '__main__': main() diff --git a/scripts/readme-gen/templates/README.tmpl.rst b/scripts/readme-gen/templates/README.tmpl.rst index 30ad03d..4fd2397 100644 --- a/scripts/readme-gen/templates/README.tmpl.rst +++ b/scripts/readme-gen/templates/README.tmpl.rst @@ -84,4 +84,4 @@ to `browse the source`_ and `report issues`_. {% endif %} -.. _Google Cloud SDK: https://cloud.google.com/sdk/ +.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index bf8e385..c3a2b39 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,11 +17,3 @@ # Generated by synthtool. DO NOT EDIT! [bdist_wheel] universal = 1 - -[sqla_testing] -requirement_cls=db_dtypes.requirements:Requirements -profile_file=.sqlalchemy_dialect_compliance-profiles.txt - -[tool:pytest] -addopts= --tb native -v -r fxX -p no:warnings -python_files=tests/*test_*.py diff --git a/setup.py b/setup.py index cd4accd..8e1e355 100644 --- a/setup.py +++ b/setup.py @@ -29,10 +29,10 @@ release_status = "Development Status :: 4 - Beta" dependencies = [ - "packaging >= 14.3", - "pandas", - "pyarrow", - "numpy", + "packaging >= 17.0", + "pandas >= 0.24.2, < 2.0dev", + "pyarrow >= 3.0.0, < 6.0dev", + "numpy >= 1.16.6, < 2.0dev", ] package_root = os.path.abspath(os.path.dirname(__file__)) @@ -70,7 +70,7 @@ def readme(): "Topic :: Database :: Front-Ends", ], platforms="Posix; MacOS X; Windows", - install_requires=[], + install_requires=dependencies, python_requires=">=3.6, <3.10", tests_require=["pytest"], ) diff --git a/testing/.gitignore b/testing/.gitignore index 40f47fa..b05fbd6 100644 --- a/testing/.gitignore +++ b/testing/.gitignore @@ -1,3 +1,3 @@ test-env.sh service-account.json -client-secrets.json +client-secrets.json \ No newline at end of file diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index 6042113..fd89d90 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -4,7 +4,7 @@ # Pin the version to the lower bound. # # e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", -sqlalchemy==1.2.0 -google-auth==1.25.0 -google-cloud-bigquery==2.25.2 -google-api-core==1.30.0 +packaging==17.0 +pandas==0.24.2 +pyarrow==3.0.0 +numpy==1.16.6 diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index e69de29..684864f 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -0,0 +1 @@ +pandas==1.1.0 diff --git a/testing/constraints-3.8.txt b/testing/constraints-3.8.txt index 4884f96..3fd8886 100644 --- a/testing/constraints-3.8.txt +++ b/testing/constraints-3.8.txt @@ -1 +1 @@ -sqlalchemy==1.3.24 +pandas==1.2.0