File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change 44import sys
55import time
66import subprocess
7- import shutil
87import hashlib
98import argparse
109
11- import urllib .request
1210
1311start_time = time .time ()
1412current_path = os .path .abspath (os .curdir )
@@ -207,6 +205,14 @@ def git_tag(tag=None):
207205 os .system (f"git tag { tag } " )
208206 os .system (f"git push --tags" )
209207
208+ # Python Build helpers -----------------------------------------------------------------------------
209+ def build_repo ():
210+ os .system (f"python -m build --sdist --wheel" )
211+ os .system (f"python -m twine check dist/*" )
212+
213+ def push_to_pypi ():
214+ os .system (f"python -m twine upload dist/*" )
215+
210216# Git repositories initialization ------------------------------------------------------------------
211217
212218def litex_setup_init_repos (config = "standard" , tag = None , dev_mode = False ):
@@ -330,11 +336,23 @@ def litex_setup_release_repos(tag):
330336 for name in install_configs ["full" ]:
331337 if name in ["migen" ]:
332338 continue
333- repo = git_repos [ name ]
339+
334340 os .chdir (os .path .join (current_path , name ))
341+
335342 # Tag Repo.
336343 print_status (f"Tagging { name } Git repository as { tag } ..." )
337344 git_tag (tag = tag )
345+
346+ # TODO: Not all repos have been uplifted for redistribution.
347+ # Eventually, this "if" check should be removed
348+ if name in ("litex" ,):
349+ # Make sure the repo builds for distribution
350+ print_status (f"Building { name } python package..." )
351+ build_repo ()
352+
353+ # Push disted artifacts to pypi
354+ print_status (f"Publishing { name } to pypi..." )
355+ push_to_pypi ()
338356 else :
339357 print_status (f"Not confirmed, exiting." )
340358
You can’t perform that action at this time.
0 commit comments