Skip to content

Commit

Permalink
use modern packaging with auto-version
Browse files Browse the repository at this point in the history
  • Loading branch information
bertsky authored and phamquiluan committed Jun 30, 2023
1 parent c86ef2d commit bdc7097
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

*To my love, Jenna*

[![pypi package](https://img.shields.io/badge/version-v0.2.1-blue)](https://pypi.org/project/jdeskew)
[![pypi package](https://img.shields.io/pypi/v/jdeskew.svg)](https://pypi.org/project/jdeskew)
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/phamquiluan/jdeskew/tree/master.svg?style=svg&circle-token=f409daaab0e6671c81bb4b266b387fe933c131eb)](https://dl.circleci.com/status-badge/redirect/gh/phamquiluan/jdeskew/tree/master)
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/25553a5195074e37a01dd3370c55abaa)](https://www.codacy.com/gh/phamquiluan/jdeskew/dashboard?utm_source=github.com&utm_medium=referral&utm_content=phamquiluan/jdeskew&utm_campaign=Badge_Coverage)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/25553a5195074e37a01dd3370c55abaa)](https://www.codacy.com/gh/phamquiluan/jdeskew/dashboard?utm_source=github.com&utm_medium=referral&utm_content=phamquiluan/jdeskew&utm_campaign=Badge_Grade)
Expand Down
1 change: 0 additions & 1 deletion jdeskew/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
"""JDeskew Packages."""
from .version import __version__ # noqa
46 changes: 46 additions & 0 deletions pyproject.toml
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?$'
Expand Down
49 changes: 2 additions & 47 deletions setup.py
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()

0 comments on commit bdc7097

Please sign in to comment.