Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,57 @@
[build-system]
requires = ["setuptools"]
requires = ["setuptools >= 62.6"]
build-backend = "setuptools.build_meta"

[project]
name = "GitPython"
description = "GitPython is a Python library used to interact with Git repositories"
authors = [
{name = "Sebastian Thiel", email = "byronimo@gmail.com"},
{name = "Michael Trier", email = "mtrier@gmail.com"},
]
readme = "README.md"
requires-python = ">=3.7"
keywords = ["git"]
# license = "BSD-3-Clause" # not done until setuptools >= 77 (Python >= 3.9)
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Typing :: Typed",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
]
dynamic = ["license", "version", "dependencies", "optional-dependencies"]

[project.urls]
"Source code" = "https://github.com/gitpython-developers/GitPython"
"Documentation" = "https://gitpython.readthedocs.io/en/stable/"

[tool.setuptools]
include-package-data = true

[tool.setuptools.dynamic]
version = {file = "VERSION"}
dependencies = {file = "requirements.txt"}
optional-dependencies."test" = {file = "test-requirements.txt"}
optional-dependencies."doc" = {file = "doc/requirements.txt"}

[tool.setuptools.packages.find]
include = ["git", "git.*"]

[tool.pytest.ini_options]
addopts = "--cov=git --cov-report=term -rfEX"
filterwarnings = "ignore::DeprecationWarning"
Expand Down
53 changes: 2 additions & 51 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
from typing import Sequence

from setuptools import setup, find_packages
from setuptools import setup
from setuptools.command.build_py import build_py as _build_py
from setuptools.command.sdist import sdist as _sdist

Expand All @@ -15,10 +15,6 @@ def _read_content(path: str) -> str:


version = _read_content("VERSION").strip()
requirements = _read_content("requirements.txt").splitlines()
test_requirements = _read_content("test-requirements.txt").splitlines()
doc_requirements = _read_content("doc/requirements.txt").splitlines()
long_description = _read_content("README.md")


class build_py(_build_py):
Expand Down Expand Up @@ -62,54 +58,9 @@ def _stamp_version(filename: str) -> None:
print("WARNING: Couldn't find version line in file %s" % filename, file=sys.stderr)


# See pyproject.toml for project metadata
setup(
name="GitPython",
cmdclass={"build_py": build_py, "sdist": sdist},
version=version,
description="GitPython is a Python library used to interact with Git repositories",
author="Sebastian Thiel, Michael Trier",
author_email="byronimo@gmail.com, mtrier@gmail.com",
license="BSD-3-Clause",
url="https://github.com/gitpython-developers/GitPython",
packages=find_packages(include=["git", "git.*"]),
include_package_data=True,
package_dir={"git": "git"},
python_requires=">=3.7",
install_requires=requirements,
extras_require={
"test": test_requirements,
"doc": doc_requirements,
},
zip_safe=False,
long_description=long_description,
long_description_content_type="text/markdown",
classifiers=[
# Picked from
# http://pypi.python.org/pypi?:action=list_classifiers
# "Development Status :: 1 - Planning",
# "Development Status :: 2 - Pre-Alpha",
# "Development Status :: 3 - Alpha",
# "Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
# "Development Status :: 6 - Mature",
# "Development Status :: 7 - Inactive",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Typing :: Typed",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
],
)
6 changes: 5 additions & 1 deletion test/test_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import functools
import os
import subprocess
import sys

from test.lib import TestBase, VirtualEnvironment, requires_symlinks, with_rw_directory

Expand Down Expand Up @@ -49,14 +50,17 @@ def _set_up_venv(rw_dir):
target_is_directory=True,
)

# Turn warnings into exceptions except for Python 3.7
pywarnings = "error" if tuple(sys.version_info)[0:2] > (3, 7) else "default"

# Create a convenience function to run commands in it.
run = functools.partial(
subprocess.run,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
cwd=venv.sources,
env={**os.environ, "PYTHONWARNINGS": "error"},
env={**os.environ, "PYTHONWARNINGS": pywarnings},
)

return venv, run
Expand Down
Loading