From 5265794b328b57452865bdad8aa6263aa5ad1231 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 2 Aug 2023 13:30:33 -0700 Subject: [PATCH] [stable-2.15] Clean up MANIFEST.in (#81414) * Clean up MANIFEST.in (#80688) * Remove unnecessary MANIFEST.in commands This eliminates more setuptools warnings during build. * Sort MANIFEST.in Now that only include commands are used, the order of the commands no longer effects the build output. (cherry picked from commit 6e325d9e4dbdc020eb520a81148866d988a5dbc5) * Omit hacking directory from MANIFEST.in (#81245) * Omit `hacking` directory from `MANIFEST.in` * Update package-data sanity test (cherry picked from commit b93a628aed2feb1a0ff68858d356895a79578149) --- MANIFEST.in | 15 +++------ changelogs/fragments/manifest-in-cleanup.yml | 9 ++++++ test/sanity/code-smell/package-data.py | 34 ++------------------ 3 files changed, 15 insertions(+), 43 deletions(-) create mode 100644 changelogs/fragments/manifest-in-cleanup.yml diff --git a/MANIFEST.in b/MANIFEST.in index d57b20cff9b..bf7a6a047e2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,18 +1,11 @@ include COPYING +include bin/* +include changelogs/CHANGELOG*.rst +include changelogs/changelog.yaml +include licenses/*.txt include requirements.txt -recursive-include licenses *.txt recursive-include packaging *.py *.j2 recursive-include test/integration * recursive-include test/sanity *.in *.json *.py *.txt recursive-include test/support *.py *.ps1 *.psm1 *.cs *.md -exclude test/sanity/code-smell/botmeta.* -exclude test/sanity/code-smell/release-names.* -exclude test/lib/ansible_test/_internal/commands/sanity/bin_symlinks.py -exclude test/lib/ansible_test/_internal/commands/sanity/integration_aliases.py recursive-include test/units * -include MANIFEST.in -include changelogs/CHANGELOG*.rst -include changelogs/changelog.yaml -include hacking/test-module.py -include hacking/update-sanity-requirements.py -include bin/* diff --git a/changelogs/fragments/manifest-in-cleanup.yml b/changelogs/fragments/manifest-in-cleanup.yml new file mode 100644 index 00000000000..457b17f8e3f --- /dev/null +++ b/changelogs/fragments/manifest-in-cleanup.yml @@ -0,0 +1,9 @@ +minor_changes: + - Removed ``exclude`` and ``recursive-exclude`` commands for generated files from the ``MANIFEST.in`` file. + These excludes were unnecessary since releases are expected to be built with a clean worktree. + - Removed ``exclude`` commands for sanity test files from the ``MANIFEST.in`` file. + These tests were previously excluded because they did not pass when run from an sdist. + However, sanity tests are not expected to pass from an sdist, so excluding some (but not all) of the failing tests makes little sense. + - Removed redundant ``include`` commands from the ``MANIFEST.in`` file. + These includes either duplicated default behavior or another command. + - Use ``include`` where ``recursive-include`` is unnecessary in the ``MANIFEST.in`` file. diff --git a/test/sanity/code-smell/package-data.py b/test/sanity/code-smell/package-data.py index 1cf7924db93..6df34ed254b 100644 --- a/test/sanity/code-smell/package-data.py +++ b/test/sanity/code-smell/package-data.py @@ -28,12 +28,8 @@ def assemble_files_to_ship(complete_file_list): '.github/*', '.github/*/*', 'changelogs/fragments/*', - 'hacking/backport/*', - 'hacking/azp/*', - 'hacking/tests/*', - 'hacking/ticket_stubs/*', - 'test/sanity/code-smell/botmeta.*', - 'test/sanity/code-smell/release-names.*', + 'hacking/*', + 'hacking/*/*', 'test/results/.tmp/*', 'test/results/.tmp/*/*', 'test/results/.tmp/*/*/*', @@ -45,32 +41,8 @@ def assemble_files_to_ship(complete_file_list): # Developer-only tools 'changelogs/README.md', 'changelogs/config.yaml', - 'hacking/README.md', - 'hacking/ansible-profile', - 'hacking/cgroup_perf_recap_graph.py', - 'hacking/create_deprecated_issues.py', - 'hacking/deprecated_issue_template.md', - 'hacking/create_deprecation_bug_reports.py', - 'hacking/fix_test_syntax.py', - 'hacking/get_library.py', - 'hacking/metadata-tool.py', - 'hacking/report.py', - 'hacking/return_skeleton_generator.py', - 'hacking/test-module', - 'test/lib/ansible_test/_internal/commands/sanity/bin_symlinks.py', - 'test/lib/ansible_test/_internal/commands/sanity/integration_aliases.py', '.cherry_picker.toml', '.mailmap', - # Possibly should be included - 'hacking/env-setup', - 'hacking/env-setup.fish', - 'MANIFEST', - 'setup.cfg', - # docs for test files not included in sdist - 'docs/docsite/rst/dev_guide/testing/sanity/bin-symlinks.rst', - 'docs/docsite/rst/dev_guide/testing/sanity/botmeta.rst', - 'docs/docsite/rst/dev_guide/testing/sanity/integration-aliases.rst', - 'docs/docsite/rst/dev_guide/testing/sanity/release-names.rst', )) # These files are generated and then intentionally added to the sdist @@ -99,8 +71,6 @@ def assemble_files_to_install(complete_file_list): """ ignore_patterns = ( # Tests excluded from sdist - 'test/lib/ansible_test/_internal/commands/sanity/bin_symlinks.py', - 'test/lib/ansible_test/_internal/commands/sanity/integration_aliases.py', ) pkg_data_files = []