changeset 6849:9638dd0fb4ea

tests: add `twine check` to test-check-sdist.t twine can check dist files for various issues (small, I would imagine, since we managed to build the dist files in the first place). Let's make use of this functionality. Not creating a separate test file for twine because we need to build the dist files first before we can check them, and it's already being done in test-check-sdist.t.
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 09 Sep 2024 16:51:00 +0400
parents e823d9117a68
children 6d22e9a596c4
files setup.py tests/hghaveaddon.py tests/test-check-sdist.t
diffstat 3 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Mon Sep 16 17:22:23 2024 +0400
+++ b/setup.py	Mon Sep 09 16:51:00 2024 +0400
@@ -40,6 +40,7 @@
     url='https://www.mercurial-scm.org/doc/evolution/',
     description='Flexible evolution of Mercurial history.',
     long_description=open(join(dirname(__file__), 'README.rst')).read(),
+    long_description_content_type='text/x-rst',
     keywords='hg mercurial',
     license='GPLv2+',
     packages=py_packages,
--- a/tests/hghaveaddon.py	Mon Sep 16 17:22:23 2024 +0400
+++ b/tests/hghaveaddon.py	Mon Sep 09 16:51:00 2024 +0400
@@ -29,6 +29,11 @@
     return hghave.matchoutput('check-manifest --version 2>&1',
                               br'check-manifest version')
 
+@hghave.check("twine", "twine utility for publishing Python packages")
+def has_twine():
+    return hghave.matchoutput('twine --help 2>&1',
+                              br'usage: twine .*\bcheck\b')
+
 @hghave.check("default-cg3", "changegroup3 by default")
 def has_default_changegroup3():
     from mercurial import configitems
--- a/tests/test-check-sdist.t	Mon Sep 16 17:22:23 2024 +0400
+++ b/tests/test-check-sdist.t	Mon Sep 09 16:51:00 2024 +0400
@@ -60,3 +60,8 @@
   [1]
   $ grep -F netlify ../files
   [1]
+
+#if twine
+  $ twine --no-color check *
+  Checking hg?evolve-*.tar.gz: PASSED (glob)
+#endif