-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use modern packaging with auto-version
- Loading branch information
1 parent
c86ef2d
commit bdc7097
Showing
4 changed files
with
49 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
"""JDeskew Packages.""" | ||
from .version import __version__ # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,49 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"setuptools_scm[toml]", | ||
"wheel", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "jdeskew" | ||
description = "Document Image Skew Estimation using Adaptive Radial Projection" | ||
authors = [{name = "Luan Pham", email = "[email protected]"}] | ||
license = {file = "LICENSE"} | ||
dependencies = [ | ||
"numpy", | ||
"opencv-python-headless" | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"black", | ||
"pytest", | ||
"coverage", | ||
"pre-commit", | ||
"pytest-xdist", | ||
"fastapi", | ||
"uvicorn[standard]", | ||
"python-multipart", | ||
] | ||
|
||
[project.readme] | ||
file = "README.md" | ||
content-type = "text/markdown" | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
[tool.setuptools.package-data] | ||
|
||
[tool.setuptools.packages.find] | ||
namespaces = false | ||
|
||
[tool.setuptools_scm] | ||
version_scheme = "no-guess-dev" | ||
|
||
[tool.black] | ||
line-length = 88 | ||
include = '\.pyi?$' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,4 @@ | ||
"""Setup file for jdeskew package.""" | ||
import os | ||
from setuptools import setup | ||
|
||
from setuptools import find_packages, setup | ||
|
||
version = None | ||
with open("README.md") as ref: | ||
data = ref.readlines()[4] | ||
version = data[data.find("version-v") + 9 : data.find("-blue")] | ||
assert version is not None, data | ||
|
||
cwd = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
|
||
def __write_version_file(): | ||
version_path = os.path.join(cwd, "jdeskew", "version.py") | ||
with open(version_path, "w") as f: | ||
f.write(f"__version__ = '{version}'\n") | ||
|
||
|
||
__write_version_file() | ||
|
||
with open("README.md", encoding="utf-8") as f: | ||
long_description = f.read() | ||
|
||
setup( | ||
name="jdeskew", | ||
description="Document Image Skew Estimation using Adaptive Radial Projection", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
author="Luan Pham", | ||
version=version, | ||
author_email="[email protected]", | ||
packages=find_packages(), | ||
include_package_data=True, | ||
install_requires=["numpy", "opencv-python-headless"], | ||
extras_require={ | ||
"dev": [ | ||
"black", | ||
"pytest", | ||
"coverage", | ||
"pre-commit", | ||
"pytest-xdist", | ||
"fastapi", | ||
"uvicorn[standard]", | ||
"python-multipart", | ||
] | ||
}, | ||
) | ||
setup() |