| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -100,5 +100,5 @@ jobs: | |||
| 100 | 100 | ||
| 101 | 101 | - name: Documentation | |
| 102 | 102 | run: | | |
| 103 | - pip install -r doc/requirements.txt | ||
| 103 | + pip install ".[doc]" | ||
| 104 | 104 | make -C doc html | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,4 +32,5 @@ python: | |||
| 32 | 32 | install: | |
| 33 | 33 | - method: pip | |
| 34 | 34 | path: . | |
| 35 | - - requirements: doc/requirements.txt | ||
| 35 | + extra_requirements: | ||
| 36 | + - doc | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,23 +1,24 @@ | |||
| 1 | 1 | #!/usr/bin/env python | |
| 2 | 2 | ||
| 3 | + import os | ||
| 4 | + import sys | ||
| 5 | + from pathlib import Path | ||
| 3 | 6 | from typing import Sequence | |
| 7 | + | ||
| 4 | 8 | from setuptools import setup, find_packages | |
| 5 | 9 | from setuptools.command.build_py import build_py as _build_py | |
| 6 | 10 | from setuptools.command.sdist import sdist as _sdist | |
| 7 | - import os | ||
| 8 | - import sys | ||
| 9 | 11 | ||
| 10 | - with open(os.path.join(os.path.dirname(__file__), "VERSION"), encoding="utf-8") as ver_file: | ||
| 11 | - VERSION = ver_file.readline().strip() | ||
| 12 | 12 | ||
| 13 | - with open("requirements.txt", encoding="utf-8") as reqs_file: | ||
| 14 | - requirements = reqs_file.read().splitlines() | ||
| 13 | + def _read_content(path: str) -> str: | ||
| 14 | + return (Path(__file__).parent / path).read_text(encoding="utf-8") | ||
| 15 | 15 | ||
| 16 | - with open("test-requirements.txt", encoding="utf-8") as reqs_file: | ||
| 17 | - test_requirements = reqs_file.read().splitlines() | ||
| 18 | 16 | ||
| 19 | - with open("README.md", encoding="utf-8") as rm_file: | ||
| 20 | - long_description = rm_file.read() | ||
| 17 | + version = _read_content("VERSION").strip() | ||
| 18 | + requirements = _read_content("requirements.txt").splitlines() | ||
| 19 | + test_requirements = _read_content("test-requirements.txt").splitlines() | ||
| 20 | + doc_requirements = _read_content("doc/requirements.txt").splitlines() | ||
| 21 | + long_description = _read_content("README.md") | ||
| 21 | 22 | ||
| 22 | 23 | ||
| 23 | 24 | class build_py(_build_py): | |
@@ -48,7 +49,7 @@ def _stamp_version(filename: str) -> None: | |||
| 48 | 49 | with open(filename) as f: | |
| 49 | 50 | for line in f: | |
| 50 | 51 | if "__version__ =" in line: | |
| 51 | - line = line.replace('"git"', "'%s'" % VERSION) | ||
| 52 | + line = line.replace('"git"', "'%s'" % version) | ||
| 52 | 53 | found = True | |
| 53 | 54 | out.append(line) | |
| 54 | 55 | except OSError: | |
@@ -64,7 +65,7 @@ def _stamp_version(filename: str) -> None: | |||
| 64 | 65 | setup( | |
| 65 | 66 | name="GitPython", | |
| 66 | 67 | cmdclass={"build_py": build_py, "sdist": sdist}, | |
| 67 | - version=VERSION, | ||
| 68 | + version=version, | ||
| 68 | 69 | description="GitPython is a Python library used to interact with Git repositories", | |
| 69 | 70 | author="Sebastian Thiel, Michael Trier", | |
| 70 | 71 | author_email="byronimo@gmail.com, mtrier@gmail.com", | |
@@ -75,7 +76,10 @@ def _stamp_version(filename: str) -> None: | |||
| 75 | 76 | package_dir={"git": "git"}, | |
| 76 | 77 | python_requires=">=3.7", | |
| 77 | 78 | install_requires=requirements, | |
| 78 | - extras_require={"test": test_requirements}, | ||
| 79 | + extras_require={ | ||
| 80 | + "test": test_requirements, | ||
| 81 | + "doc": doc_requirements, | ||
| 82 | + }, | ||
| 79 | 83 | zip_safe=False, | |
| 80 | 84 | long_description=long_description, | |
| 81 | 85 | long_description_content_type="text/markdown", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ ignore_outcome = true | |||
| 36 | 36 | [testenv:html] | |
| 37 | 37 | description = Build HTML documentation | |
| 38 | 38 | base_python = py{39,310,311,312,38,37} | |
| 39 | - deps = -r doc/requirements.txt | ||
| 39 | + extras = doc | ||
| 40 | 40 | allowlist_externals = make | |
| 41 | 41 | commands = | |
| 42 | 42 | make BUILDDIR={env_tmp_dir}/doc/build -C doc clean | |
| Back | FazBrowse Home | New Git URL |
0 commit comments