Skip to content Navigation Menu Toggle navigation Sign in Appearance settings PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub Copilot appDirect agents from issue to mergeMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing Search or jump to... Search code, repositories, users, issues, pull requests... Search Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Saved searches Use saved searches to filter your results more quickly Name Query To see all available qualifiers, see our documentation. Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} gitpython-developers / GitPython Public Uh oh! There was an error while loading. Please reload this page. Notifications You must be signed in to change notification settings Fork 980 Star 5.1k Code Issues 166 Pull requests 11 Discussions Actions Security and quality 8 Insights Additional navigation options Code Issues Pull requests Discussions Actions Security and quality Insights FilesExpand file tree mainBreadcrumbsGitPython/setup.pyCopy pathBlameMore file actionsBlameMore file actions Latest commit HistoryHistoryHistoryexecutable file·112 lines (97 loc) · 3.79 KB mainBreadcrumbsGitPython/setup.pyCopy pathTopFile metadata and controlsCodeBlameexecutable file·112 lines (97 loc) · 3.79 KBRawCopy raw fileDownload raw fileOpen symbols panelEdit and raw actions123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112#!/usr/bin/env python import osfrom pathlib import Pathimport sysfrom typing import Sequence from setuptools import setup, find_packagesfrom setuptools.command.build_py import build_py as _build_pyfrom setuptools.command.sdist import sdist as _sdist def _read_content(path: str) -> str: return (Path(__file__).parent / path).read_text(encoding="utf-8") 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): def run(self) -> None: init = os.path.join(self.build_lib, "git", "__init__.py") if os.path.exists(init): os.unlink(init) _build_py.run(self) _stamp_version(init) self.byte_compile([init]) class sdist(_sdist): def make_release_tree(self, base_dir: str, files: Sequence) -> None: _sdist.make_release_tree(self, base_dir, files) orig = os.path.join("git", "__init__.py") assert os.path.exists(orig), orig dest = os.path.join(base_dir, orig) if hasattr(os, "link") and os.path.exists(dest): os.unlink(dest) self.copy_file(orig, dest) _stamp_version(dest) def _stamp_version(filename: str) -> None: found, out = False, [] try: with open(filename) as f: for line in f: if "__version__ =" in line: line = line.replace('"git"', "'%s'" % version) found = True out.append(line) except OSError: print("Couldn't find file %s to stamp version" % filename, file=sys.stderr) if found: with open(filename, "w") as f: f.writelines(out) else: print("WARNING: Couldn't find version line in file %s" % filename, file=sys.stderr) 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(exclude=["test", "test.*"]), 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", ],) You can’t perform that action at this time.