Skip to content

Commit

Permalink
Prefer pep517 for loading project metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jan 30, 2021
1 parent 5a86007 commit 881be97
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
7 changes: 6 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
v7.6.0
======

* Prefer ``pep517`` for loading project metadata.

v7.5.0
======

Switched to PEP 420 for ``jaraco`` namespace.
* Switched to PEP 420 for ``jaraco`` namespace.

v7.4.0
======
Expand Down
7 changes: 0 additions & 7 deletions jaraco/develop/py36compat.py

This file was deleted.

13 changes: 4 additions & 9 deletions jaraco/develop/repo.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
import sys
import subprocess
import urllib.parse

import pep517.meta
from jaraco.collections import ItemsAsAttributes

from .py36compat import subprocess_run_text


class Bunch(dict, ItemsAsAttributes):
pass


def get_project_metadata():
url, version = subprocess_run_text(
[sys.executable, 'setup.py', '--url', '--version'],
check=True,
stdout=subprocess.PIPE,
).stdout.split()
dist = pep517.meta.load('.')
url = dist.metadata['Home-page']
version = dist.version
project = urllib.parse.urlparse(url).path.strip('/')
return Bunch(locals())
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ install_requires =
PyNaCl
subprocess32; python_version < "3.7"
packaging
pep517
setup_requires = setuptools_scm[toml] >= 3.4.1

[options.packages.find]
Expand Down

0 comments on commit 881be97

Please sign in to comment.