Skip to content

Commit

Permalink
Move "install_requires" into setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Apr 5, 2021
1 parent 7c818e4 commit 69945b9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 18 deletions.
7 changes: 0 additions & 7 deletions repo_helper/templates/__pkginfo__._py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,13 @@
import pathlib

__all__ = [
"__copyright__",
"__version__",
"repo_root",
"install_requires",
"extras_require",
]

__copyright__ = """
{{ copyright_years }} {{ author }} <{{ email }}>
"""

__version__ = "{{ version }}"
repo_root = pathlib.Path(__file__).parent
install_requires = (repo_root / "requirements.txt").read_text(encoding="utf-8").split('\n')
extras_require = {{ extras_require }}

{{ '\n'.join(pkginfo_extra) }}
2 changes: 2 additions & 0 deletions repo_helper/templates/setup._py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Comment={{ short_desc }}
))
{% endif %}

install_requires = (repo_root / "requirements.txt").read_text(encoding="utf-8").split('\n')

{{ "\n".join(setup_pre) }}

setup(
Expand Down
2 changes: 1 addition & 1 deletion repo_helper/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Helpers for running tests with pytest.
.. extras-require:: testing
:__pkginfo__:
:pyproject:
.. versionadded:: 2020.11.17
"""
Expand Down
7 changes: 0 additions & 7 deletions tests/test_files/test_packaging_/test_make_pkginfo._py_
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,11 @@
import pathlib

__all__ = [
"__copyright__",
"__version__",
"repo_root",
"install_requires",
"extras_require",
]

__copyright__ = """
2020 Joe Bloggs <j.bloggs@example.com>
"""

__version__ = "1.2.3"
repo_root = pathlib.Path(__file__).parent
install_requires = (repo_root / "requirements.txt").read_text(encoding="utf-8").split('\n')
extras_require = {}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ sys.path.append('.')
# this package
from __pkginfo__ import * # pylint: disable=wildcard-import

install_requires = (repo_root / "requirements.txt").read_text(encoding="utf-8").split('\n')

setup(
description="a short description",
extras_require=extras_require,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ from setuptools import setup

sys.path.append('.')

# stdlib
import datetime

# this package
from __pkginfo__ import * # pylint: disable=wildcard-import

install_requires = (repo_root / "requirements.txt").read_text(encoding="utf-8").split('\n')

# stdlib
import datetime

print(datetime.datetime.now)

setup(
Expand Down

0 comments on commit 69945b9

Please sign in to comment.