Skip to content

Commit 6169dc9

Browse files
committed
Modernize package structure.
1 parent 3e2d2c4 commit 6169dc9

File tree

4 files changed

+29
-46
lines changed

4 files changed

+29
-46
lines changed

pyproject.toml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[build-system]
2+
requires = ["setuptools >= 64"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
authors = [
7+
{ name = "Zejiang Shen", email = "[email protected]" },
8+
{ name = "Jorge Oses", email = "[email protected]" },
9+
{ name = "Thomas Buhrmann", email = "[email protected]" },
10+
]
11+
name = "notion_df"
12+
description = "Notion-DF: Seamlessly Connecting Notion Database with Pandas DataFrame"
13+
readme = "README.md"
14+
requires-python = ">=3.8"
15+
license = { file = "LICENSE" }
16+
dynamic = ["version"]
17+
dependencies = ["notion-client>=2.2.1", "pandas>=2.0.2", "pydantic>=2.9.2"]
18+
19+
[project.optional-dependencies]
20+
dev = ["black", "pytest"]
21+
22+
[project.urls]
23+
Repository = "https://github.com/graphext/notion-df"
24+
25+
[tool.setuptools.dynamic]
26+
version = { attr = "notion_df.__version__" }

requirements.txt

-4
This file was deleted.

setup.py

+2-41
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,3 @@
1-
from setuptools import setup, find_packages
2-
import os
1+
from setuptools import setup
32

4-
5-
def get_requirements(req_file):
6-
reqs = []
7-
with open(req_file, "r") as fp:
8-
for line in fp.readlines():
9-
if line.startswith("#") or line.strip() == "":
10-
continue
11-
else:
12-
reqs.append(line.strip())
13-
return reqs
14-
15-
16-
# A trick from https://github.com/jina-ai/jina/blob/79b302c93b01689e82cf4b52f46522eb7497c404/setup.py#L20
17-
libinfo_py = os.path.join("src", "notion_df", "__init__.py")
18-
libinfo_content = open(libinfo_py, "r", encoding="utf8").readlines()
19-
version_line = [l.strip() for l in libinfo_content if l.startswith("__version__")][0]
20-
exec(version_line) # gives __version__
21-
22-
setup(
23-
name="notion-df",
24-
version=__version__,
25-
description="Notion-DF: Seamlessly Connecting Notion Database with Pandas DataFrame",
26-
author="Zejiang Shen",
27-
author_email="[email protected]",
28-
license="MIT",
29-
url="https://github.com/lolipopshock/notion-df",
30-
package_dir={"": "src"},
31-
packages=find_packages("src"),
32-
long_description=open("README.md", "r", encoding="utf-8").read(),
33-
long_description_content_type="text/markdown",
34-
python_requires=">=3.6",
35-
install_requires=get_requirements("requirements.txt"),
36-
extras_require={
37-
"dev": [
38-
"black==21.12b0",
39-
"pytest",
40-
],
41-
}
42-
)
3+
setup()

src/notion_df/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from notion_df.agent import download, upload, config
22
from notion_df._pandas import pandas
33

4-
__version__ = "0.0.5"
4+
__version__ = "0.0.6"

0 commit comments

Comments
 (0)