Update package-data sanity test (#80344)

The test no longer relies on the Makefile.
pull/80346/head
Matt Clay 2 years ago committed by GitHub
parent 052da3c89e
commit 46362bbd27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,6 +4,7 @@ import contextlib
import fnmatch import fnmatch
import glob import glob
import os import os
import pathlib
import re import re
import shutil import shutil
import subprocess import subprocess
@ -11,6 +12,10 @@ import sys
import tarfile import tarfile
import tempfile import tempfile
import packaging.version
from ansible.release import __version__
def assemble_files_to_ship(complete_file_list): def assemble_files_to_ship(complete_file_list):
""" """
@ -169,8 +174,13 @@ def clean_repository(file_list):
def create_sdist(tmp_dir): def create_sdist(tmp_dir):
"""Create an sdist in the repository""" """Create an sdist in the repository"""
# Make sure a changelog exists for this version when testing from devel.
# When testing from a stable branch the changelog will already exist.
version = packaging.version.Version(__version__)
pathlib.Path(f'changelogs/CHANGELOG-v{version.major}.{version.minor}.rst').touch()
create = subprocess.run( create = subprocess.run(
['make', 'snapshot', 'SDIST_DIR=%s' % tmp_dir], [sys.executable, '-m', 'build', '--sdist', '--config-setting=--build-manpages', '--outdir', tmp_dir],
stdin=subprocess.DEVNULL, stdin=subprocess.DEVNULL,
capture_output=True, capture_output=True,
text=True, text=True,

@ -1,3 +1,4 @@
build
docutils < 0.18 # match version required by sphinx in the docs-build sanity test docutils < 0.18 # match version required by sphinx in the docs-build sanity test
jinja2 jinja2
pyyaml # ansible-core requirement pyyaml # ansible-core requirement

@ -1,12 +1,15 @@
# edit "package-data.requirements.in" and generate with: hacking/update-sanity-requirements.py --test package-data # edit "package-data.requirements.in" and generate with: hacking/update-sanity-requirements.py --test package-data
antsibull-changelog==0.19.0 antsibull-changelog==0.19.0
build==0.10.0
docutils==0.17.1 docutils==0.17.1
Jinja2==3.1.2 Jinja2==3.1.2
MarkupSafe==2.1.2 MarkupSafe==2.1.2
packaging==23.0 packaging==23.0
pyproject_hooks==1.0.0
PyYAML==6.0 PyYAML==6.0
resolvelib==1.0.1 resolvelib==1.0.1
rstcheck==5.0.0 rstcheck==5.0.0
semantic-version==2.10.0 semantic-version==2.10.0
tomli==2.0.1
types-docutils==0.18.3 types-docutils==0.18.3
typing_extensions==4.5.0 typing_extensions==4.5.0

Loading…
Cancel
Save