Skip to content

Commit

Permalink
makedirs, easier packaging in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
justquick committed Dec 5, 2021
1 parent 2d4f8bb commit 214dadd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 43 deletions.
5 changes: 4 additions & 1 deletion pdf12step/templating.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import re
from os import path
from os import path, makedirs
from datetime import datetime
from collections import defaultdict
from functools import reduce
Expand Down Expand Up @@ -181,6 +181,9 @@ def prerender(self):
Prerenders the assets ahead of page render to ensure proper values in assets are set
"""
for template, dest in ASSET_TEMPLATES.items():
dest_dir = path.dirname(dest)
if not path.isdir(dest_dir):
makedirs(dest_dir)
with open(dest, 'w') as destfile:
destfile.write(self.render(template))

Expand Down
41 changes: 0 additions & 41 deletions pyproject.toml

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Framework :: Flask',
Expand Down
18 changes: 18 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

[tox]
envlist = py36,py37,py38

[testenv]
deps =
requests
Flask
Flask-WeasyPrint
weasyprint
attrdict
PyYAML

pytest
ipython

commands =
pytest --pdb --pdbcls=IPython.terminal.debugger:TerminalPdb -s

0 comments on commit 214dadd

Please sign in to comment.