-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move requirements into setup.py to aid conda. #9
- Loading branch information
1 parent
98621f4
commit 55abe3a
Showing
3 changed files
with
22 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
jinja_partials - Simple reuse of partial HTML page templates in the Jinja template language for Python web frameworks. | ||
""" | ||
|
||
__version__ = '0.2.0' | ||
__version__ = '0.2.1' | ||
__author__ = 'Michael Kennedy <[email protected]>' | ||
__all__ = [ | ||
'register_extensions', | ||
|
@@ -29,7 +29,7 @@ | |
except ImportError: | ||
starlette = None | ||
|
||
if TYPE_CHECKING: | ||
if TYPE_CHECKING and flask and starlette: | ||
from flask import Flask | ||
from starlette.templating import Jinja2Templates | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,25 +6,27 @@ | |
from setuptools import setup | ||
|
||
|
||
def read(filename): | ||
filename = os.path.join(os.path.dirname(__file__), filename) | ||
text_type = type(u"") | ||
with io.open(filename, mode="r", encoding='utf-8') as fd: | ||
return re.sub(text_type(r':[a-z]+:`~?(.*?)`'), text_type(r'``\1``'), fd.read()) | ||
|
||
|
||
with open('./requirements.txt', 'r', encoding='utf-8') as fin: | ||
requires_list = [line.strip() for line in fin if line and line.strip()] | ||
def read_readme(filename): | ||
try: | ||
filename = os.path.join(os.path.dirname(__file__), filename) | ||
text_type = type(u"") | ||
with io.open(filename, mode="r", encoding='utf-8') as fd: | ||
return re.sub(text_type(r':[a-z]+:`~?(.*?)`'), text_type(r'``\1``'), fd.read()) | ||
except: | ||
return '' | ||
|
||
|
||
def read_version(): | ||
filename = os.path.join(os.path.dirname(__file__), 'jinja_partials', '__init__.py') | ||
with open(filename, mode="r", encoding='utf-8') as fin2: | ||
for line in fin2: | ||
if line and line.strip() and line.startswith('__version__'): | ||
return line.split('=')[1].strip().strip("'").strip('"') | ||
try: | ||
filename = os.path.join(os.path.dirname(__file__), 'jinja_partials', '__init__.py') | ||
with open(filename, mode="r", encoding='utf-8') as fin2: | ||
for line in fin2: | ||
if line and line.strip() and line.startswith('__version__'): | ||
return line.split('=')[1].strip().strip("'").strip('"') | ||
|
||
return "0.0.0.0" | ||
return "0.0.0.0" | ||
except: | ||
return "0.0.0.0" | ||
|
||
|
||
setup( | ||
|
@@ -37,12 +39,12 @@ def read_version(): | |
author_email="[email protected]", | ||
|
||
description="Simple reuse of partial HTML page templates in the Jinja template language for Python web frameworks.", | ||
long_description=read("README.md"), | ||
long_description=read_readme("README.md"), | ||
long_description_content_type="text/markdown", | ||
|
||
packages=find_packages(exclude=('tests', 'example', 'readme_resources', 'build', 'dist',)), | ||
|
||
install_requires=requires_list, | ||
install_requires=['jinja2'], | ||
|
||
classifiers=[ | ||
'Development Status :: 2 - Pre-Alpha', | ||
|