Skip to content

Commit

Permalink
Merge pull request #537 from mkniewallner/use-setup-cfg
Browse files Browse the repository at this point in the history
Use `setup.cfg` to define most package metadata
  • Loading branch information
abusi committed Oct 6, 2021
2 parents 51ebec1 + 7ade7a7 commit e4b879f
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 51 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ clean:

.PHONY: set-dev-version
set-dev-version:
bash -c "sed -i -e 's!^\(\s*_VERSION = \).*!\1\"$(shell $(MAKE) get-version).dev$(shell date +\"%s\")\"!' setup.py"
@bash -c "sed -i -e 's!^\(\s*version = \).*!\1$(shell $(MAKE) get-version).dev$(shell date +\"%s\")!' setup.cfg"

.PHONY: run-docs
run-docs:
docker-compose up docs

.PHONY: get-version
get-version:
@echo $(shell cat setup.py | grep "_VERSION =" | egrep -o '[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?')
@echo $(shell cat setup.cfg | grep "version =" | egrep -o '[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?')
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[build-system]
requires = [
"setuptools>=39.2.0",
"wheel"
]
build-backend = "setuptools.build_meta"

[tool.black]
line_length = 79
target-version = ["py36"]
Expand Down
56 changes: 56 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[metadata]
name = tartiflette
version = 1.4.0
description = GraphQL Engine for Python
long_description = file: README.md
long_description_content_type = text/markdown
url = https://tartiflette.io
author = Dailymotion Core API Team
author_email = [email protected]
license = MIT
license_files = LICENSE
project_urls =
Documentation = https://tartiflette.io
Source code = https://github.com/tartiflette/tartiflette
Changelog = https://github.com/tartiflette/tartiflette/blob/master/CHANGELOG.md
Issue tracker = https://github.com/tartiflette/tartiflette/issues
classifiers =
Intended Audience :: Developers
Topic :: Software Development :: Libraries
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
keywords =
api
graphql
protocol
rest
relay
tartiflette
dailymotion

[options]
python_requires = >=3.6
install_requires =
cffi>=1.0.0,<2.0.0
lark-parser==0.12.0
packages = find:
include_package_data = True

[options.extras_require]
test =
pytest==6.2.5
pytest-cov==2.12.1
pytest-asyncio==0.15.1
pytest-xdist==2.3.0
pylint==2.10.2
black==21.8b0
isort==5.9.3
benchmark = pytest-benchmark==3.4.1

[options.packages.find]
exclude = tests*
50 changes: 1 addition & 49 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import subprocess
import sys

from setuptools import Extension, find_packages, setup
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext
from setuptools.command.build_py import build_py

Expand Down Expand Up @@ -51,55 +51,7 @@ def __init__(self):
super().__init__("libgraphqlparser", sources=[])


_TEST_REQUIRE = [
"pytest==6.2.5",
"pytest-cov==2.12.1",
"pytest-asyncio==0.15.1",
"pytest-xdist==2.3.0",
"pylint==2.10.2",
"black==21.8b0",
"isort==5.9.3",
]

_BENCHMARK_REQUIRE = ["pytest-benchmark==3.4.1"]

_VERSION = "1.4.0"

_PACKAGES = find_packages(exclude=["tests*"])


def _read_file(filename):
with open(filename) as afile:
return afile.read()


setup(
name="tartiflette",
version=_VERSION,
description="GraphQL Engine for Python",
long_description=_read_file("README.md"),
long_description_content_type="text/markdown",
url="https://github.com/tartiflette/tartiflette",
author="Dailymotion Core API Team",
author_email="[email protected]",
license="MIT",
classifiers=[
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
keywords="api graphql protocol api rest relay tartiflette dailymotion",
packages=_PACKAGES,
install_requires=["cffi>=1.0.0,<2.0.0", "lark-parser==0.12.0"],
tests_require=_TEST_REQUIRE,
extras_require={"test": _TEST_REQUIRE, "benchmark": _BENCHMARK_REQUIRE},
cmdclass={"build_ext": BuildExtCmd, "build_py": BuildPyCmd},
ext_modules=[LibGraphQLParserExtension()],
include_package_data=True,
)

0 comments on commit e4b879f

Please sign in to comment.