-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathsetup.py
51 lines (43 loc) · 1.43 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import os
import shutil
import subprocess
from setuptools import find_packages, setup
def get_version_from_git():
try:
git_path = shutil.which("git")
if git_path is None:
raise ValueError("Git is not installed")
result = subprocess.run(
[git_path, "describe", "--tags", "--abbrev=0"],
text=True,
capture_output=True,
check=True,
)
return result.stdout.strip()
except Exception:
return "0.0.0"
version = os.getenv("RELEASE_VERSION", get_version_from_git())
with open("README.md", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name="git-import-contributions",
version=version,
packages=find_packages(where="src"),
package_dir={"": "src"},
include_package_data=True,
package_data={
"git_import_contributions": ["README.md"],
},
install_requires=["gitpython"],
python_requires=">=3.10",
entry_points={
"console_scripts": [
"git-import-contributions=git_import_contributions.cli:main",
],
},
author="Miro Mannino",
description="This tool helps users to import contributions to GitHub from private git repositories, or from public repositories that are not hosted in GitHub",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/miromannino/Contributions-Importer-For-Github",
)