Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🛠 Refactored setup.py to setup.cfg #1359

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
[metadata]
name = starlette
version = attr: starlette.__init__.__version__
author = Tom Christie
author_email = [email protected]
description = The little ASGI library that shines.
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/encode/starlette
license = BSD
classifiers =
Development Status :: 3 - Alpha
Environment :: Web Environment
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Topic :: Internet :: WWW/HTTP
Programming Language :: Python :: 3
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

[options]
packages = find:
include_package_data = True
zip_safe = False
python_requires = >=3.6
install_requires =
anyio >=3.0.0, <4
typing_extensions; python_version <'3.8'
contextlib2 >=21.6.0; python_version <'3.7'

[options.package_data]
starlette = py.typed

[options.packages.find]
exclude =
tests*

[options.extras_require]
full =
itsdangerous
jinja2
python-multipart
pyyaml
requests


[flake8]
ignore = W503, E203, B305
max-line-length = 88
Expand Down
67 changes: 2 additions & 65 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,69 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup

import os
import re

from setuptools import setup, find_packages


def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
with open(os.path.join(package, "__init__.py")) as f:
return re.search("__version__ = ['\"]([^'\"]+)['\"]", f.read()).group(1)


def get_long_description():
"""
Return the README.
"""
with open("README.md", encoding="utf8") as f:
return f.read()


setup(
name="starlette",
python_requires=">=3.6",
version=get_version("starlette"),
url="https://github.com/encode/starlette",
license="BSD",
description="The little ASGI library that shines.",
long_description=get_long_description(),
long_description_content_type="text/markdown",
author="Tom Christie",
author_email="[email protected]",
packages=find_packages(exclude=["tests*"]),
package_data={"starlette": ["py.typed"]},
include_package_data=True,
install_requires=[
"anyio>=3.0.0,<4",
"typing_extensions; python_version < '3.8'",
"contextlib2 >= 21.6.0; python_version < '3.7'",
],
extras_require={
"full": [
"itsdangerous",
"jinja2",
"python-multipart",
"pyyaml",
"requests",
]
},
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Topic :: Internet :: WWW/HTTP",
"Programming Language :: Python :: 3",
"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",
],
zip_safe=False,
)
setup()