Skip to content

Commit 1cc987b

Browse files
committed
Add pyproject.toml
1 parent 408ed3a commit 1cc987b

File tree

7 files changed

+79
-5
lines changed

7 files changed

+79
-5
lines changed

bin/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ setup
1111

1212
rm -rf *.egg-info build dist
1313
find . -name '*.pyc' -exec rm -rf {} \;
14-
python setup.py sdist bdist_wheel
14+
hatchling build

bin/freenit.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ help() {
1212

1313

1414
if [ "${1}" = "--version" ]; then
15-
python${PY_VERSION} -c 'from freenit.version import version; print(version)'
15+
python${PY_VERSION} -c 'from freenit import __version__; print(__version__)'
1616
exit 0
1717
fi
1818

freenit/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.3.0"

freenit/cli.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import subprocess
2+
from prompt_toolkit import prompt
3+
4+
def main():
5+
project_name = prompt("Name of the project: ")
6+
subprocess.run(["bin/freenit.sh", "project", project_name])

freenit/version.py

-1
This file was deleted.

pyproject.toml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "freenit"
7+
dynamic = ["version"]
8+
description = "REST API framework based on FastAPI"
9+
readme = "README.md"
10+
license = {file = "LICENSE"}
11+
requires-python = ">=3.8"
12+
dependencies = [
13+
"fastapi",
14+
"passlib",
15+
"pydantic[email]",
16+
"pyjwt",
17+
]
18+
authors = [
19+
{name = "Goran Mekić", email = "[email protected]"},
20+
]
21+
classifiers = [
22+
"Development Status :: 4 - Beta",
23+
"Intended Audience :: Developers",
24+
"Topic :: Internet :: WWW/HTTP",
25+
"Environment :: Web Environment",
26+
"Programming Language :: Python"
27+
]
28+
29+
[project.optional-dependencies]
30+
beanie = ["beanie"]
31+
dev = [
32+
"aiosqlite",
33+
"black",
34+
"isort",
35+
"uvicorn",
36+
]
37+
ldap = ["bonsai"]
38+
ormar = [
39+
"alembic",
40+
"ormar",
41+
]
42+
test = [
43+
"aiosqlite",
44+
"bandit",
45+
"black",
46+
"httpx",
47+
"isort",
48+
"pytest-asyncio",
49+
"pytest-factoryboy",
50+
"requests",
51+
]
52+
53+
[project.urls]
54+
Homepage = "https://freenit.org"
55+
Repository = "https://github.com/freenit-framework/backend"
56+
57+
[project.scripts]
58+
freenit = "freenit.cli:main"
59+
60+
[tool.hatch.version]
61+
path = "freenit/__init__.py"
62+
63+
[tool.hatch.build.targets.wheel]
64+
only-include = ["freenit", "bin"]
65+
66+
[tool.hatch.build.targets.wheel.sources]
67+
"src" = ""
68+
"bin" = "freenit/bin"

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from setuptools import find_packages, setup
66

7-
from freenit.version import version
7+
from freenit import __version__
88

99
PROJECT_ROOT = pathlib.Path(__file__).parent
1010
README = (PROJECT_ROOT / "README.md").read_text()
@@ -47,7 +47,7 @@
4747

4848
setup(
4949
name="freenit",
50-
version=version,
50+
version=__version__,
5151
description="REST API framework based on FastAPI",
5252
long_description=README,
5353
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)