-
-
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
Conversation
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) |
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.
Should we move this part into httpx/httpx/__version__.py
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.
No because you can't import httpx until after setup
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
setup.py
already does not import http.__version__.__version__
because of this limitation. It's not an edge case
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.
I meant having this file to accomplish only this one task.
@@ -1,3 +1,50 @@ | |||
[metadata] | |||
name = httpx | |||
version = attr: src.get_version |
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
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly you don't need license =
if there's a trove available
There's no trove classifier for BSD-3-Clause
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.
license = BSD | |
license = BSD-3-Clause |
version = attr: src.get_version | ||
url = https://github.com/encode/httpx | ||
license = BSD | ||
description = The next generation HTTP client. |
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.
This is duplicated from httpx.__version__.__description__
because this key doesn't support attr:
if people are ok with me adding importlib_resources I'll change it to a file:
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 comment
The 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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
License :: OSI Approved :: BSD License |
92c463d
to
efba460
Compare
This also fixes #193 Here it is showing that py.typed ends up in the sdist and whl https://asciinema.org/a/6HXD5BEhcKtetzesXuCY8Fkex |
6dac231
to
0eb6b3c
Compare
…)" This reverts commit b479ceb.
Revert 441 add py typed to manifest
So I don't think we should do this unless we want to move to flit+pyproject.toml (which I'd be a fan of, idk about what others think @florimondmanca, @tomchristie?) |
Although this is a very interesting change (I didn't know setuptools supported All other Encode projects use So, I agree with @sethmlarson and would be in favor of closing this. I'd be open to see how switching to a |
Gonna go ahead and close this, thank you for putting this together! Would love if you went through all the setuptools options we're missing like issue tracker, docs, etc. |
No description provided.