-
-
Notifications
You must be signed in to change notification settings - Fork 834
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
use declarative metadata #442
Changes from all commits
0b92a60
efba460
0eb6b3c
caa04c9
1750d6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,3 +1,49 @@ | ||||||
[metadata] | ||||||
name = httpx | ||||||
version = attr: src.get_version | ||||||
url = https://github.com/encode/httpx | ||||||
license = BSD | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There's no trove classifier for BSD-3-Clause There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
description = The next generation HTTP client. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is duplicated from |
||||||
long_description = file: README.md, file: CHANGELOG.md | ||||||
graingert marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
long_description_content_type = text/markdown | ||||||
author = Tom Christie | ||||||
author_email = tom@tomchristie.com | ||||||
classifiers = | ||||||
Development Status :: 3 - Alpha | ||||||
Environment :: Web Environment | ||||||
Intended Audience :: Developers | ||||||
License :: OSI Approved :: BSD License | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This license is wrong. This package is licensed under the BSD 3 clause There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
Operating System :: OS Independent | ||||||
Topic :: Internet :: WWW/HTTP | ||||||
Framework :: AsyncIO | ||||||
Framework :: Trio | ||||||
Programming Language :: Python :: 3 | ||||||
Programming Language :: Python :: 3.6 | ||||||
Programming Language :: Python :: 3.7 | ||||||
Programming Language :: Python :: 3.8 | ||||||
|
||||||
[options] | ||||||
python_requires = >=3.6 | ||||||
packages = find: | ||||||
zip_safe = False | ||||||
graingert marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
install_requires = | ||||||
certifi | ||||||
chardet==3.* | ||||||
h11==0.8.* | ||||||
h2==3.* | ||||||
hstspreload>=2019.8.27 | ||||||
idna==2.* | ||||||
rfc3986==1.* | ||||||
|
||||||
[options.packages.find] | ||||||
include = | ||||||
httpx | ||||||
httpx.* | ||||||
|
||||||
[options.package_data] | ||||||
httpx = | ||||||
py.typed | ||||||
|
||||||
[bdist_wheel] | ||||||
universal = 1 | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,3 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import re | ||
from pathlib import Path | ||
|
||
from setuptools import setup | ||
graingert marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
def get_version(package): | ||
""" | ||
Return package version as listed in `__version__` in `init.py`. | ||
""" | ||
version = Path(package, "__version__.py").read_text() | ||
return re.search("__version__ = ['\"]([^'\"]+)['\"]", version).group(1) | ||
|
||
|
||
def get_long_description(): | ||
""" | ||
Return the README. | ||
""" | ||
long_description = "" | ||
with open("README.md", encoding="utf8") as f: | ||
long_description += f.read() | ||
long_description += "\n\n" | ||
with open("CHANGELOG.md", encoding="utf8") as f: | ||
long_description += f.read() | ||
return long_description | ||
|
||
|
||
def get_packages(package): | ||
""" | ||
Return root package and all sub-packages. | ||
""" | ||
return [str(path.parent) for path in Path(package).glob("**/__init__.py")] | ||
|
||
|
||
setup( | ||
name="httpx", | ||
python_requires=">=3.6", | ||
version=get_version("httpx"), | ||
url="https://github.com/encode/httpx", | ||
license="BSD", | ||
description="The next generation HTTP client.", | ||
long_description=get_long_description(), | ||
long_description_content_type="text/markdown", | ||
author="Tom Christie", | ||
author_email="tom@tomchristie.com", | ||
package_data={"httpx": ["py.typed"]}, | ||
packages=get_packages("httpx"), | ||
include_package_data=True, | ||
zip_safe=False, | ||
install_requires=[ | ||
"certifi", | ||
"chardet==3.*", | ||
"h11==0.8.*", | ||
"h2==3.*", | ||
"hstspreload>=2019.8.27", | ||
"idna==2.*", | ||
"rfc3986==1.*", | ||
], | ||
classifiers=[ | ||
"Development Status :: 3 - Alpha", | ||
"Environment :: Web Environment", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: BSD License", | ||
"Operating System :: OS Independent", | ||
"Topic :: Internet :: WWW/HTTP", | ||
"Framework :: AsyncIO", | ||
"Framework :: Trio", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
], | ||
) | ||
setup() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import pathlib | ||
import re | ||
|
||
PACKAGE = "httpx" | ||
|
||
|
||
def get_version(package=PACKAGE): | ||
version = pathlib.Path(package, "__version__.py").read_text() | ||
return re.search("__version__ = ['\"]([^'\"]+)['\"]", version).group(1) | ||
Comment on lines
+1
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we move this part into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No because you can't import httpx until after setup There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly this one edge-case has me not wanting to merge this. :( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I meant having this file to accomplish only this one task. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imho this should be a file (httpx/version.txt) and we use importlib_resources in
__version__
to grab it