Skip to content

Commit

Permalink
SNOW-1058245-sqlalchemy-20-support: update VERSION syntax and add pyp…
Browse files Browse the repository at this point in the history
…roject.toml
  • Loading branch information
sfc-gh-mraba committed Feb 16, 2024
1 parent 6827249 commit a984ae4
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 4 deletions.
81 changes: 81 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" },
]
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"]
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/snowflake/sqlalchemy/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion src/snowflake/sqlalchemy/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit a984ae4

Please sign in to comment.