Skip to content

Commit

Permalink
Refactor(CI/CD): make it so that deployment only requires tag push (#…
Browse files Browse the repository at this point in the history
…1638)

* Refactor(CI/CD): make it so that deployment only requires tag push

* Get rid of __version__ = .. in __init__.py

* Import sqlglot._version file in __init__.py
  • Loading branch information
georgesittas authored May 16, 2023
1 parent 40820b1 commit b9140b6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,6 @@ dmypy.json
.DS_STORE
metastore_db
spark_warehouse

# Version file
sqlglot/_version.py
17 changes: 6 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
from setuptools import find_packages, setup

version = (
open("sqlglot/__init__.py")
.read()
.split("__version__ = ")[-1]
.split("\n")[0]
.strip("")
.strip("'")
.strip('"')
)

setup(
name="sqlglot",
version=version,
description="An easily customizable SQL parser and transpiler",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
Expand All @@ -22,6 +11,12 @@
license="MIT",
packages=find_packages(include=["sqlglot", "sqlglot.*"]),
package_data={"sqlglot": ["py.typed"]},
use_scm_version={
"write_to": "sqlglot/_version.py",
"fallback_version": "0.0.0",
"local_scheme": "no-local-version",
},
setup_requires=["setuptools_scm"],
extras_require={
"dev": [
"autoflake",
Expand Down
6 changes: 5 additions & 1 deletion sqlglot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
T = t.TypeVar("T", bound=Expression)


__version__ = "13.0.1"
try:
from sqlglot._version import __version__, __version_tuple__ # type: ignore
except ImportError:
pass


pretty = False
"""Whether to format generated SQL by default."""
Expand Down

0 comments on commit b9140b6

Please sign in to comment.