1- import os
2- import subprocess
3- import re
4- from setuptools import find_packages , setup
5- import io
6-
7- __version__ = None
1+ import pathlib
2+ from setuptools import setup
83
4+ # The directory containing this file
5+ HERE = pathlib .Path (__file__ ).parent
96# The text of the README file
10- README = io .open ("README.md" , encoding = "utf-8" ).read ()
11-
12-
13- def get_latest_git_tag (filepath ):
14- try :
15- return (
16- subprocess .check_output (
17- ["git" , "describe" , "--tags" , "--abbrev=0" ],
18- cwd = os .path .dirname (filepath ),
19- )
20- .strip ()
21- .decode ()
22- )
23- except subprocess .CalledProcessError :
24- return "no_tag_found"
25-
26-
27- APP_NAME = "mindee"
28- PACKAGE_NAME = "mindee"
29- GIT_URL = "https://github.com/publicMindee/mindee-api-python"
30- VERSION = "v0.2"
31-
32-
33- def make_requirements_list (file = "requirements.txt" , only_regular = True ):
34- """
35- Make a list of package requirements from a requirements.txt file
36- :param file: path to txt file
37- :param only_regular: remove rows with /, #, space or empty
38- :return:
39- """
40-
41- with open (file ) as f :
42- lines = f .read ().splitlines ()
43- if only_regular :
44- regex = (
45- "\/$|^#|^$$|^git\+"
46- ) # remove line with /, starting by # or space or empty
47- return [line for line in lines if not re .findall (regex , line )]
48- else :
49- return lines
507
8+ README = (HERE / "README.md" ).read_text ()
9+ # This call to setup() does all the work
5110
5211setup (
53- python_requires = ">=3.0" ,
54- name = f"{ PACKAGE_NAME } " ,
55- version = VERSION ,
56- license = "MIT" ,
12+ name = "mindee" ,
13+ version = "0.0.1" ,
14+ description = "Mindee SDK repository" ,
5715 long_description = README ,
5816 long_description_content_type = "text/markdown" ,
59- url = GIT_URL ,
60- packages = find_packages (),
17+ # url="https://github.com/publicMindee/python-sdk",
6118 author = "Mindee" ,
6219 author_email = "contact@mindee.com" ,
63- install_requires = make_requirements_list (),
64- include_package_data = True
20+ license = "MIT" ,
21+ classifiers = [
22+ "License :: OSI Approved :: MIT License" ,
23+ "Programming Language :: Python :: 3" ,
24+ ],
25+ packages = ["mindee" ],
26+ include_package_data = True ,
27+ install_requires = []
6528)
0 commit comments