| 
									
										
										
										
											2024-07-12 00:17:15 -05:00
										 |  |  | # -*- coding: utf-8; -*- | 
					
						
							|  |  |  | """
 | 
					
						
							|  |  |  | Tasks for wuttaweb | 
					
						
							|  |  |  | """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import os | 
					
						
							|  |  |  | import shutil | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | from invoke import task | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @task | 
					
						
							|  |  |  | def release(c, skip_tests=False): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     Release a new version of WuttJamaican | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     if not skip_tests: | 
					
						
							| 
									
										
										
										
											2025-08-31 12:26:43 -05:00
										 |  |  |         c.run("pytest") | 
					
						
							| 
									
										
										
										
											2024-07-12 00:17:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # rebuild pkg | 
					
						
							| 
									
										
										
										
											2025-08-31 12:26:43 -05:00
										 |  |  |     if os.path.exists("dist"): | 
					
						
							|  |  |  |         shutil.rmtree("dist") | 
					
						
							|  |  |  |     if os.path.exists("WuttJamaican.egg-info"): | 
					
						
							|  |  |  |         shutil.rmtree("WuttJamaican.egg-info") | 
					
						
							|  |  |  |     c.run("python -m build --sdist") | 
					
						
							| 
									
										
										
										
											2024-07-12 00:17:15 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # upload | 
					
						
							| 
									
										
										
										
											2025-08-31 12:26:43 -05:00
										 |  |  |     c.run("twine upload dist/*") |