Unify requirements files location & source in setup.py (#2598)

Co-authored-by: Trim21 <trim21.me@gmail.com>
This commit is contained in:
Jirka Borovec
2023-07-18 12:30:02 +02:00
committed by GitHub
co-authored by Trim21
parent f259db9fda
commit 2edc0f8f17
9 changed files with 30 additions and 26 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ jobs:
- run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-types.txt
pip install -r requirements/types.txt
- uses: liskin/gh-problem-matcher-wrap@v2
with:
action: add
@@ -40,6 +40,6 @@ jobs:
with:
python-version: "3.8"
- run: pip install -r requirements.txt
- run: pip install -r requirements/docs.txt
- run: pip install -e .
- run: sphinx-build doc build
+1 -1
View File
@@ -74,7 +74,7 @@ def get_protected_branch(self):
First you need to install the test dependencies:
```bash
pip install -r test-requirements.txt
pip install -r requirements/test.txt
```
Then you can run the tests through `pytest`.
+4 -6
View File
@@ -1,9 +1,7 @@
pynacl>=1.4.0
pynacl >=1.4.0
python-dateutil
requests>=2.14.0
pyjwt[crypto]>=2.4.0
requests >=2.14.0
pyjwt[crypto] >=2.4.0
typing-extensions >=4.0.0
urllib3
sphinx<3
Jinja2<3.1
sphinx-rtd-theme<1.1
Deprecated
+3
View File
@@ -0,0 +1,3 @@
sphinx <3
Jinja2 <3.1
sphinx-rtd-theme <1.1
+4
View File
@@ -0,0 +1,4 @@
httpretty >=1.0.3
pytest >=5.3
pytest-cov >=2.8
pytest-github-actions-annotate-failures <1.0.0
@@ -1,4 +1,4 @@
mypy
mypy >=1.0.0
types-deprecated
types-jwt
types-python-dateutil
+13 -10
View File
@@ -1,5 +1,4 @@
#!/usr/bin/env python
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
@@ -40,10 +39,21 @@
# #
################################################################################
import os
import textwrap
import setuptools
_PATH_ROOT = os.path.dirname(__file__)
_PATH_REQUIRES = os.path.join(_PATH_ROOT, "requirements")
def _load_requirements(path_dir: str = _PATH_ROOT, file_name: str = "requirements.txt") -> "list[str]":
with open(os.path.join(path_dir, file_name)) as fp:
reqs = [ln.strip() for ln in fp.readlines()]
return [r for r in reqs if r and not r.startswith("#")]
if __name__ == "__main__":
setuptools.setup(
name="PyGithub",
@@ -110,15 +120,8 @@ if __name__ == "__main__":
"Topic :: Software Development",
],
python_requires=">=3.7",
install_requires=[
"deprecated",
"pyjwt[crypto]>=2.4.0",
"pynacl>=1.4.0",
"requests>=2.14.0",
"python-dateutil",
"typing-extensions>=4.0.0",
],
install_requires=_load_requirements(path_dir=_PATH_ROOT, file_name="requirements.txt"),
# can be removed, still here to avoid breaking user code
extras_require={"integrations": []},
tests_require=["httpretty>=1.0.3"],
tests_require=_load_requirements(path_dir=_PATH_REQUIRES, file_name="test.txt"),
)
-4
View File
@@ -1,4 +0,0 @@
httpretty>=1.0.3
pytest>=5.3
pytest-cov>=2.8
pytest-github-actions-annotate-failures<1.0.0
+2 -2
View File
@@ -15,14 +15,14 @@ python =
3.11: py311
[testenv]
deps = -rtest-requirements.txt
deps = -rrequirements/test.txt
commands = pytest --cov=github --cov-report=xml {posargs}
[testenv:lint]
basepython = python3.8
skip_install = true
deps =
-r requirements-types.txt
-r requirements/types.txt
pre-commit
commands =
pre-commit run --all-files --show-diff-on-failure