1+ from json import loads
2+ from setuptools import setup , find_packages
3+
4+ author = "Author"
5+ project_name = "ProjectName"
6+ email = "Email"
7+ description = "Description"
8+ readme_file_type = "text/markdown"
9+ project_url = "GitHub URL"
10+ python_version_requirement = ">=3.6"
11+
12+ try :
13+ from requests import get
14+ requests_module_found = True
15+ except ModuleNotFoundError :
16+ requests_module_found = False
17+
18+ if requests_module_found :
19+ tag_data = get (f"https://api.github.com/repos/{ author } /{ project_name } /tags" )
20+ latest_tag = loads (tag_data .text )[0 ]["name" ]
21+ else :
22+ latest_tag = "0.0.0"
23+
24+ with open ("README.md" , "r" , encoding = "utf-8" ) as fh :
25+ long_description = fh .read ()
26+
27+ """
28+ classifiers = [
29+ "Programming Language :: Python :: 3",
30+ "License :: OSI Approved :: MIT License",
31+ "Operating System :: OS Independent",]
32+
33+ python_requires = ">=3.6"
34+ """
35+
36+ setup (
37+ name = project_name ,
38+ version = latest_tag ,
39+ author = author ,
40+ author_email = email ,
41+ description = description ,
42+ long_description = long_description ,
43+ long_description_content_type = readme_file_type ,
44+ url = project_url ,
45+ project_urls = {
46+ "Bug Tracker" : f"{ project_url } /issues" ,
47+ },
48+ classifiers = [],
49+ package_dir = {"" : "src" },
50+ packages = find_packages (where = "src" ),
51+ python_requires = python_version_requirement
52+ )
0 commit comments