From a984ae4fd6d306bbfeabbb4ab6192ccb6baa9e57 Mon Sep 17 00:00:00 2001 From: Marcin Raba Date: Fri, 16 Feb 2024 11:43:55 +0100 Subject: [PATCH] SNOW-1058245-sqlalchemy-20-support: update VERSION syntax and add pyproject.toml --- pyproject.toml | 81 ++++++++++++++++++++++++++ setup.py | 4 +- src/snowflake/sqlalchemy/_constants.py | 2 +- src/snowflake/sqlalchemy/version.py | 3 +- 4 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..9b655d53 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,81 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "snowflake-sqlalchemy" +dynamic = ["version"] +description = "Snowflake SQLAlchemy Dialect" +readme = "README.md" +license = "Apache-2.0" +requires-python = ">=3.8" +authors = [ + { name = "Snowflake Inc.", email = "triage-snowpark-python-api-dl@snowflake.com" }, +] +keywords = ["Snowflake", "analytics", "cloud", "database", "db", "warehouse"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Environment :: Other Environment", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Intended Audience :: Information Technology", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: SQL", + "Topic :: Database", + "Topic :: Scientific/Engineering :: Information Analysis", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Application Frameworks", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dependencies = [ + # "importlib-metadata;python_version<\"3.8\"", + "snowflake-connector-python", + # "sqlalchemy>=2.0.0", + "sqlalchemy<2.0.0", +] + +[project.optional-dependencies] +development = [ + "mock", + "numpy", + "pytest", + "pytest-cov", + "pytest-rerunfailures", + "pytest-timeout", + "pytz", +] +pandas = ["snowflake-connector-python[pandas]"] + +[project.entry-points."sqlalchemy.dialects"] +snowflake = "snowflake.sqlalchemy:dialect" + +[project.urls] +Changelog = "https://github.com/snowflakedb/snowflake-sqlalchemy/blob/main/DESCRIPTION.md" +Documentation = "https://docs.snowflake.com/en/user-guide/sqlalchemy.html" +Homepage = "https://www.snowflake.com/" +Issues = "https://github.com/snowflakedb/snowflake-sqlalchemy/issues" +Source = "https://github.com/snowflakedb/snowflake-sqlalchemy" + +[tool.hatch.version] +path = "src/snowflake/sqlalchemy/version.py" + +[tool.hatch.envs.local] +features = ["development", "pandas"] +python = "3.8" + +[tool.hatch.build.targets.sdist] +exclude = ["/.github"] + +[tool.hatch.build.targets.wheel] +packages = ["src/snowflake"] diff --git a/setup.py b/setup.py index 0ec32717..bac39fef 100644 --- a/setup.py +++ b/setup.py @@ -7,10 +7,10 @@ from setuptools import setup SQLALCHEMY_SRC_DIR = os.path.join("src", "snowflake", "sqlalchemy") -VERSION = (1, 1, 1, None) # Default +VERSION = "1.1.1" with open(os.path.join(SQLALCHEMY_SRC_DIR, "version.py"), encoding="utf-8") as f: exec(f.read()) - version = ".".join([str(v) for v in VERSION if v is not None]) + version = VERSION setup( version=version, diff --git a/src/snowflake/sqlalchemy/_constants.py b/src/snowflake/sqlalchemy/_constants.py index dad5b19b..46af4454 100644 --- a/src/snowflake/sqlalchemy/_constants.py +++ b/src/snowflake/sqlalchemy/_constants.py @@ -9,4 +9,4 @@ PARAM_INTERNAL_APPLICATION_VERSION = "internal_application_version" APPLICATION_NAME = "SnowflakeSQLAlchemy" -SNOWFLAKE_SQLALCHEMY_VERSION = ".".join([str(v) for v in VERSION if v is not None]) +SNOWFLAKE_SQLALCHEMY_VERSION = VERSION diff --git a/src/snowflake/sqlalchemy/version.py b/src/snowflake/sqlalchemy/version.py index 6aea4f54..3295201b 100644 --- a/src/snowflake/sqlalchemy/version.py +++ b/src/snowflake/sqlalchemy/version.py @@ -3,4 +3,5 @@ # # Update this for the versions # Don't change the forth version number from None -VERSION = (1, 5, 1, None) +# VERSION = (1, 5, 1, None) +VERSION = "1.5.1"