Skip to content

Commit c0540e8

Browse files
committed
setup.py
1 parent 048f050 commit c0540e8

4 files changed

Lines changed: 43 additions & 15 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# json_sql
22

3-
`json_sql` is a Python library that allows you to run sql queries on JSON data. It is designed to be simple and easy to use, while providing powerful features for querying and manipulating JSON data.
3+
`json_sql` is a Python library that allows you to **run SQL queries on JSON data**. It is designed to be simple and easy to use, while providing powerful features for querying and manipulating JSON data.
44

55
## Usage
66

pyproject.toml

Lines changed: 0 additions & 14 deletions
This file was deleted.

requirements.txt

Whitespace-only changes.

setup.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import os
2+
import pathlib
3+
import re
4+
5+
from setuptools import find_packages, setup
6+
7+
# The directory containing this file
8+
HERE = pathlib.Path(__file__).parent
9+
10+
# The text of the README file
11+
README = (HERE / "README.md").read_text(encoding="utf-8")
12+
13+
# The list of requirements
14+
REQUIREMENTS = (HERE / "requirements.txt").read_text(encoding="utf-8").split("\n")
15+
16+
# Version
17+
VERSION_FILE = HERE / "VERSION"
18+
if VERSION_FILE.exists():
19+
VERSION = VERSION_FILE.read_text(encoding="utf-8").strip()
20+
else:
21+
regex = r"^v(\d+\.\d+\.\d+)$"
22+
TAG = os.getenv("TAG", "v0.0.0")
23+
if not TAG or not re.search(regex, TAG):
24+
raise ValueError("TAG environment variable must be in the format v1.2.3")
25+
26+
match = re.search(regex, TAG)
27+
VERSION = match.group(1) if match else "0.0.0"
28+
29+
setup(
30+
name="json_sql",
31+
license="MIT",
32+
version=VERSION,
33+
description="run SQL queries on JSON data",
34+
python_requires=">=3.8, <4",
35+
long_description=README,
36+
long_description_content_type="text/markdown",
37+
author="Abstra",
38+
author_email="help@abstra.app",
39+
url="https://github.com/abstra-app/json-sql",
40+
packages=find_packages(exclude=["tests"]),
41+
install_requires=REQUIREMENTS,
42+
)

0 commit comments

Comments
 (0)