@@ -58,11 +58,24 @@ def bootstrap(context):
5858 run_invoke (context , "pip install -r requirements.development.txt" )
5959
6060
61- @task
61+ @task ( aliases = [ "b" ])
6262def build (context ):
6363 run_invoke (
6464 context , "cd submodules/html2pdf && npm install && npm run build"
6565 )
66+ # Windows can't do slashes for this one.
67+ run_invoke (
68+ context ,
69+ """
70+ cd html2print && mkdir html2pdf_js
71+ """ ,
72+ )
73+ run_invoke (
74+ context ,
75+ """
76+ cp submodules/html2pdf/dist/bundle.js html2print/html2pdf_js/html2pdf.min.js
77+ """ ,
78+ )
6679
6780
6881@task
@@ -193,6 +206,30 @@ def clean_itest_artifacts(context):
193206 run_invoke (context , find_command , warn = True )
194207
195208
209+ @task
210+ def package (context ):
211+ build (context )
212+
213+ run_invoke (
214+ context ,
215+ """
216+ rm -rfv dist/
217+ """ ,
218+ )
219+ run_invoke (
220+ context ,
221+ """
222+ python3 -m build
223+ """ ,
224+ )
225+ run_invoke (
226+ context ,
227+ """
228+ twine check dist/*
229+ """ ,
230+ )
231+
232+
196233@task
197234def release (context , test_pypi = False , username = None , password = None ):
198235 """
@@ -205,6 +242,8 @@ def release(context, test_pypi=False, username=None, password=None):
205242 # tokens set up on a local machine.
206243 assert username is None or password is not None
207244
245+ package (context )
246+
208247 repository_argument_or_none = (
209248 ""
210249 if username
@@ -216,24 +255,6 @@ def release(context, test_pypi=False, username=None, password=None):
216255 )
217256 user_password = f"-u{ username } -p{ password } " if username is not None else ""
218257
219- run_invoke (
220- context ,
221- """
222- rm -rfv dist/
223- """ ,
224- )
225- run_invoke (
226- context ,
227- """
228- python3 -m build
229- """ ,
230- )
231- run_invoke (
232- context ,
233- """
234- twine check dist/*
235- """ ,
236- )
237258 # The token is in a core developer's .pypirc file.
238259 # https://test.pypi.org/manage/account/token/
239260 # https://packaging.python.org/en/latest/specifications/pypirc/#pypirc
0 commit comments