From 692fa895e9a1d0d2b33307b612e24f11ad7cc538 Mon Sep 17 00:00:00 2001 From: Felix Andreas Date: Wed, 22 Apr 2020 21:16:29 +0200 Subject: [PATCH] initial setup for poetry --- latticejson/__about__.py | 9 +++------ pyproject.toml | 36 ++++++++++++++++++++++++++++++++++++ setup.py | 37 ------------------------------------- 3 files changed, 39 insertions(+), 43 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/latticejson/__about__.py b/latticejson/__about__.py index d4d8692..dd053d9 100644 --- a/latticejson/__about__.py +++ b/latticejson/__about__.py @@ -1,6 +1,3 @@ -__title__ = "LatticeJSON" -__description__ = "A JSON based lattice file format" -__url__ = "https://github.com/andreasfelix/latticejson" -__version__ = "0.0.4" -__author__ = "Felix Andreas" -__license__ = "GNU General Public License v3.0" +import pkg_resources + +__version__ = pkg_resources.get_distribution("latticejson").version diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..dd9b973 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,36 @@ +[tool.poetry] +name = "LatticeJSON" +version = "0.0.4" +description = "A JSON based lattice file format" +authors = ["Felix Andreas"] +repository = "https://github.com/nobeam/latticejson" +documentation = "https://nobeam.github.io/latticejson/" +readme = "README.md" +license = "GPL-3.0" +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Scientific/Engineering", +] + +[tool.poetry.scripts] +latticejson = "latticejson.cli:cli" + +[tool.poetry.dependencies] +python = "^3.6" +click = ">=7.0" +fastjsonschema = "*" +lark-parser = "*" + +[tool.poetry.dev-dependencies] +pytest = "^5.2" + +[build-system] +requires = ["poetry>=0.12"] +build-backend = "poetry.masonry.api" diff --git a/setup.py b/setup.py deleted file mode 100644 index 40f8201..0000000 --- a/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -from typing import Dict -from pathlib import Path -from setuptools import setup, find_packages - -base_path = Path(__file__).resolve().parent -about: Dict[str, str] = {} -exec((base_path / "latticejson/__about__.py").read_text(), about) -readme = (base_path / "README.md").read_text() - -setup( - name=about["__title__"], - version=about["__version__"], - description=about["__description__"], - long_description=readme, - long_description_content_type="text/markdown", - url=about["__url__"], - author=about["__author__"], - license=about["__license__"], - packages=find_packages(), - install_requires=["fastjsonschema", "click>=7.0", "lark-parser"], - test_requires=["pytest"], - python_requires=">=3.6", - include_package_data=True, - package_data={"latticejson": ["schema.json", "map.json", "*.lark"]}, - entry_points={"console_scripts": ["latticejson=latticejson.cli:cli"]}, - classifiers=[ - "Development Status :: 3 - Alpha", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - "Topic :: Scientific/Engineering", - ], -)