1+ import io
2+ import os
3+ import re
4+
5+ from setuptools import find_packages
6+ from setuptools import setup
7+
8+
9+ def read_readme (filename : str ) -> str :
10+ try :
11+ filename = os .path .join (os .path .dirname (__file__ ), filename )
12+ text_type = type (u"" )
13+ with io .open (filename , mode = "r" , encoding = 'utf-8' ) as fd :
14+ return re .sub (text_type (r':[a-z]+:`~?(.*?)`' ), text_type (r'``\1``' ), fd .read ())
15+ except : # noqa: E722
16+ return ''
17+
18+
19+ def read_version ():
20+ try :
21+ filename = os .path .join (os .path .dirname (__file__ ), 'jinja_partials' , '__init__.py' )
22+ with open (filename , mode = "r" , encoding = 'utf-8' ) as fin2 :
23+ for line in fin2 :
24+ if line and line .strip () and line .startswith ('__version__' ):
25+ return line .split ('=' )[1 ].strip ().strip ("'" ).strip ('"' )
26+
27+ return "0.0.0.0"
28+ except : # noqa: E722
29+ return "0.0.0.0"
30+
31+
32+ setup (
33+ name = "jinja_partials" ,
34+ version = read_version (),
35+ url = "https://github.com/mikeckennedy/jinja_partials" ,
36+ license = 'MIT' ,
37+
38+ author = "Michael Kennedy" ,
39+ 40+
41+ description = "Simple reuse of partial HTML page templates in the Jinja template language for Python web frameworks." ,
42+ long_description = read_readme ("README.md" ),
43+ long_description_content_type = "text/markdown" ,
44+
45+ packages = find_packages (exclude = ('tests' , 'example' , 'readme_resources' , 'build' , 'dist' ,)),
46+
47+ install_requires = ['jinja2' ],
48+ exclude = ['build' , 'dist' , '.github' , 'example' , 'tests' ],
49+
50+ classifiers = [
51+ 'Development Status :: 5 - Production/Stable' ,
52+ 'License :: OSI Approved :: MIT License' ,
53+ 'Programming Language :: Python' ,
54+ 'Programming Language :: Python :: 3' ,
55+ 'Programming Language :: Python :: 3.8' ,
56+ 'Programming Language :: Python :: 3.9' ,
57+ 'Programming Language :: Python :: 3.10' ,
58+ 'Programming Language :: Python :: 3.11' ,
59+ 'Programming Language :: Python :: 3.12' ,
60+ 'Programming Language :: Python :: 3.13' ,
61+ 'Programming Language :: Python :: 3.14' ,
62+ ],
63+ )
0 commit comments