Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around setuptools 63 deprecations #502

Merged
merged 9 commits into from
Apr 7, 2023

Conversation

felixfontein
Copy link
Collaborator

Fixes #433.
Closes #434.

This uses a modified (#433 (comment), #433 (comment)) version of @gotmax23's proposal in #433 (comment).

This only uses the new approach from Ansible 8 on, to avoid suddenly breaking Ansible 7.5.0+.

@felixfontein
Copy link
Collaborator Author

Ok, there is one problem: dotfiles in subdirectories of docs/ or tests/ are kept as well.

@felixfontein
Copy link
Collaborator Author

Aaand I was able to solve that one by adding:

    exclude_package_data={
        'ansible_collections': ['*/*/tests/**/.*'],
        'ansible_collections.community': ['*/tests/**/.*'],
        'ansible_collections.community.sops': ['tests/**/.*'],
    },

this gets rid of all .gitignore and .sops.yaml files in community.sops's tests directory. If I delete any of these three lines, the files are back (all of them). Only these three lines together make them go away.

(Don't ask me how I figured that out... resp. how many combinations I tried...)

@felixfontein felixfontein marked this pull request as draft March 30, 2023 20:02
@felixfontein
Copy link
Collaborator Author

Hmm, while that works, I noticed another problem: subdirectories further down in the tree that are called tests or docs are removed as well. For example ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/ansible.cfg is part of the sdist, but not of the wheel, even though it is not in ansible_collections/cyberark/conjur/tests/.

@felixfontein
Copy link
Collaborator Author

The thing is that setuptools's find_namespace_packages() uses fnmatch.fnmatchcase() to match package names against these patterns, and * matches a string with an arbitrary amount of . in it.

@felixfontein
Copy link
Collaborator Author

I was able to work around these problems by avoiding wildcards if possible, but some files are still removed from the wheel, for example:

ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/CACHEDIR.TAG
ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/.gitignore
ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/README.md
ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/v/cache/nodeids
ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/v/cache/stepwise

while these are files we actually don't want to have in the wheel, this could have also hit other files like .gitignore or .whatever-else.

@felixfontein
Copy link
Collaborator Author

Maybe it would be easier to simply remove all dotfiles everywhere.

You can find all 474 dotfiles (and dot directories) in a hypothetical Ansible 8.0.0 release below.

  • amazon/aws/changelogs/fragments/.keep
  • amazon/aws/.coveragerc
  • amazon/aws/.github
  • amazon/aws/.gitignore
  • amazon/aws/tests/.gitignore
  • amazon/aws/tests/unit/plugins/modules/placebo_recordings/.gitkeep
  • ansible/netcommon/changelogs/fragments/.keep
  • ansible/netcommon/.flake8
  • ansible/netcommon/.github
  • ansible/netcommon/.gitignore
  • ansible/netcommon/.isort.cfg
  • ansible/netcommon/.pre-commit-config.yaml
  • ansible/netcommon/.prettierignore
  • ansible/netcommon/tests/.gitignore
  • ansible/netcommon/.yamllint
  • ansible/posix/.azure-pipelines
  • ansible/posix/changelogs/fragments/.keep
  • ansible/posix/.github
  • ansible/posix/.gitignore
  • ansible/posix/tests/.gitignore
  • ansible/utils/changelogs/fragments/.keep
  • ansible/utils/.flake8
  • ansible/utils/.github
  • ansible/utils/.gitignore
  • ansible/utils/.isort.cfg
  • ansible/utils/.pre-commit-config.yaml
  • ansible/utils/.prettierignore
  • ansible/utils/.yamllint
  • ansible/windows/.azure-pipelines
  • ansible/windows/changelogs/fragments/.keep
  • ansible/windows/.git-blame-ignore-revs
  • ansible/windows/.github
  • ansible/windows/.gitignore
  • ansible/windows/tests/.gitignore
  • arista/eos/changelogs/fragments/.keep
  • arista/eos/.github
  • arista/eos/.gitignore
  • arista/eos/.pre-commit-config.yaml
  • arista/eos/tests/.gitignore
  • arista/eos/.yamllint
  • azure/azcollection/.gitignore
  • check_point/mgmt/changelogs/.plugin-cache.yaml
  • chocolatey/chocolatey/changelogs/.plugin-cache.yaml
  • cisco/aci/changelogs/.gitignore
  • cisco/aci/changelogs/.plugin-cache.yaml
  • cisco/aci/.DS_Store
  • cisco/aci/.github
  • cisco/aci/.gitignore
  • cisco/aci/.pytest_cache
  • cisco/aci/.pytest_cache/.gitignore
  • cisco/aci/tests/.gitignore
  • cisco/aci/tests/unit/module_utils/.pytest_cache
  • cisco/aci/tests/unit/module_utils/.pytest_cache/.gitignore
  • cisco/aci/.vscode
  • cisco/asa/changelogs/fragments/.keep
  • cisco/asa/.github
  • cisco/asa/.gitignore
  • cisco/asa/.pre-commit-config.yaml
  • cisco/asa/tests/.gitignore
  • cisco/asa/.yamllint
  • cisco/dnac/.DS_Store
  • cisco/dnac/.github
  • cisco/dnac/.gitignore
  • cisco/dnac/plugins/.DS_Store
  • cisco/dnac/.vscode
  • cisco/intersight/.DS_Store
  • cisco/intersight/.gitignore
  • cisco/intersight/.vscode
  • cisco/ios/changelogs/fragments/.keep
  • cisco/ios/.config
  • cisco/ios/.github
  • cisco/ios/.gitignore
  • cisco/ios/.isort.cfg
  • cisco/ios/.pre-commit-config.yaml
  • cisco/ios/.prettierignore
  • cisco/ios/tests/.gitignore
  • cisco/iosxr/changelogs/fragments/.keep
  • cisco/iosxr/.config
  • cisco/iosxr/.github
  • cisco/iosxr/.gitignore
  • cisco/iosxr/.isort.cfg
  • cisco/iosxr/.pre-commit-config.yaml
  • cisco/iosxr/.prettierignore
  • cisco/iosxr/tests/.gitignore
  • cisco/iosxr/.yamllint
  • cisco/iosxr/.zuul.yaml
  • cisco/ios/.yamllint
  • cisco/ise/.DS_Store
  • cisco/ise/.github
  • cisco/ise/.gitignore
  • cisco/ise/roles/personas_deployment/.travis.yml
  • cisco/ise/.vscode
  • cisco/meraki/changelogs/.plugin-cache.yaml
  • cisco/meraki/.pytest_cache
  • cisco/meraki/.pytest_cache/.gitignore
  • cisco/mso/changelogs/.gitignore
  • cisco/mso/changelogs/.plugin-cache.yaml
  • cisco/mso/.DS_Store
  • cisco/mso/.github
  • cisco/mso/.gitignore
  • cisco/mso/tests/.gitignore
  • cisco/mso/.vscode
  • cisco/nso/changelogs/.plugin-cache.yaml
  • cisco/nso/.github
  • cisco/nso/.gitignore
  • cisco/nxos/changelogs/fragments/.keep
  • cisco/nxos/.config
  • cisco/nxos/.github
  • cisco/nxos/.gitignore
  • cisco/nxos/.isort.cfg
  • cisco/nxos/.pre-commit-config.yaml
  • cisco/nxos/.prettierignore
  • cisco/nxos/tests/.gitignore
  • cisco/nxos/tests/integration/targets/nxos_prefix_lists/tests/common/.DS_Store
  • cisco/nxos/tests/integration/targets/nxos_prefix_lists/tests/.DS_Store
  • cisco/ucs/.gitignore
  • cloud/common/changelogs/fragments/.keep
  • cloudscale_ch/cloud/changelogs/fragments/.keep
  • cloudscale_ch/cloud/changelogs/.gitignore
  • cloudscale_ch/cloud/.github
  • cloudscale_ch/cloud/.gitignore
  • community/aws/changelogs/fragments/.keep
  • community/aws/.github
  • community/aws/.gitignore
  • community/aws/tests/.gitignore
  • community/aws/tests/unit/plugins/modules/placebo_recordings/.gitkeep
  • community/azure/.azure-pipelines
  • community/azure/changelogs/fragments/.keep
  • community/azure/tests/.gitignore
  • community/ciscosmb/changelogs/fragments/.keep
  • community/ciscosmb/.github
  • community/ciscosmb/.gitignore
  • community/crypto/.azure-pipelines
  • community/crypto/changelogs/fragments/.keep
  • community/crypto/.github
  • community/crypto/.reuse
  • community/crypto/tests/.gitignore
  • community/digitalocean/changelogs/fragments/.keep
  • community/digitalocean/changelogs/.gitignore
  • community/digitalocean/.github
  • community/digitalocean/.gitignore
  • community/dns/changelogs/fragments/.keep
  • community/dns/.github
  • community/dns/.reuse
  • community/docker/.azure-pipelines
  • community/docker/changelogs/fragments/.keep
  • community/docker/.github
  • community/docker/.reuse
  • community/fortios/changelogs/fragments/.keep
  • community/fortios/.github
  • community/general/.azure-pipelines
  • community/general/changelogs/fragments/.keep
  • community/general/changelogs/.gitignore
  • community/general/.github
  • community/general/.gitignore
  • community/general/.pre-commit-config.yaml
  • community/general/.reuse
  • community/general/tests/.gitignore
  • community/general/tests/integration/targets/django_manage/files/base_test/startproj/.keep
  • community/general/tests/integration/targets/terraform/.gitignore
  • community/google/changelogs/fragments/.keep
  • community/google/.github
  • community/grafana/.all-contributorsrc
  • community/grafana/.github
  • community/grafana/.gitignore
  • community/grafana/tests/.gitignore
  • community/hashi_vault/changelogs/fragments/.keep
  • community/hashi_vault/docs/preview/.gitignore
  • community/hashi_vault/.git-blame-ignore-revs
  • community/hashi_vault/.github
  • community/hashi_vault/tests/integration/.ansible-lint
  • community/hashi_vault/tests/integration/targets/setup_cert_content/files/.gitignore
  • community/hashi_vault/tests/integration/targets/setup_localenv_docker/files/.output
  • community/hashi_vault/tests/integration/targets/setup_localenv_docker/files/.output/.gitignore
  • community/hashi_vault/tests/integration/targets/setup_localenv_gha/files/.gitignore
  • community/hashi_vault/tests/integration/targets/setup_localenv_gha/files/.output
  • community/hrobot/changelogs/fragments/.keep
  • community/hrobot/.github
  • community/hrobot/.reuse
  • community/libvirt/.azure-pipelines
  • community/libvirt/.gitignore
  • community/mongodb/changelogs/.plugin-cache.yaml
  • community/mongodb/.github
  • community/mongodb/.gitignore
  • community/mongodb/roles/mongodb_auth/.yamllint
  • community/mongodb/roles/mongodb_config/.yamllint
  • community/mongodb/roles/mongodb_install/.yamllint
  • community/mongodb/roles/mongodb_mongod/.yamllint
  • community/mongodb/roles/mongodb_mongos/.yamllint
  • community/mongodb/roles/mongodb_repository/.yamllint
  • community/mongodb/roles/mongodb_selinux/.yamllint
  • community/mysql/changelogs/fragments/.keep
  • community/mysql/.github
  • community/mysql/.gitignore
  • community/network/.azure-pipelines
  • community/network/changelogs/fragments/.keep
  • community/network/changelogs/.gitignore
  • community/network/.github
  • community/network/.gitignore
  • community/okd/changelogs/.plugin-cache.yaml
  • community/okd/.gitignore
  • community/okd/.yamllint
  • community/postgresql/.azure-pipelines
  • community/postgresql/changelogs/fragments/.keep
  • community/postgresql/.github
  • community/proxysql/.github
  • community/proxysql/.gitignore
  • community/proxysql/roles/proxysql/.yamllint
  • community/rabbitmq/.azure-pipelines
  • community/rabbitmq/.gitignore
  • community/routeros/changelogs/fragments/.keep
  • community/routeros/.github
  • community/routeros/.reuse
  • community/sap/changelogs/fragments/.keep
  • community/sap/.github
  • community/sap_libs/changelogs/fragments/.keep
  • community/sap_libs/.github
  • community/sap_libs/.vscode
  • community/sap/.vscode
  • community/skydive/.github
  • community/skydive/.gitignore
  • community/skydive/tests/.gitignore
  • community/skydive/.yamllint
  • community/sops/changelogs/fragments/.keep
  • community/sops/.github
  • community/sops/.gitignore
  • community/sops/.reuse
  • community/sops/tests/ee/roles/lookup_sops/files/.sops.yaml
  • community/sops/tests/integration/targets/filter_decrypt/files/.sops.yaml
  • community/sops/tests/integration/targets/load_vars/vars/.sops.yaml
  • community/sops/tests/integration/targets/lookup_sops/files/.sops.yaml
  • community/sops/tests/integration/targets/sops_encrypt/files/.sops.yaml
  • community/sops/tests/integration/targets/var_sops/.gitignore
  • community/sops/tests/integration/targets/var_sops/.sops.yaml
  • community/sops/tests/integration/targets/var_sops/test-stage-inv-cache/.gitignore
  • community/sops/tests/integration/targets/var_sops/test-stage-inv-no-cache/.gitignore
  • community/sops/tests/integration/targets/var_sops/test-stage-task-cache/.gitignore
  • community/sops/tests/integration/targets/var_sops/test-stage-task-no-cache/.gitignore
  • community/vmware/.github
  • community/vmware/.gitignore
  • community/vmware/tests/.gitignore
  • community/vmware/.yamllint.yaml
  • community/windows/.azure-pipelines
  • community/windows/changelogs/fragments/.keep
  • community/windows/.git-blame-ignore-revs
  • community/windows/.github
  • community/windows/.gitignore
  • community/windows/tests/.gitignore
  • community/windows/tests/integration/targets/win_lineinfile/files/expectations/.gitattributes
  • community/windows/.vscode
  • community/zabbix/.ansible-lint
  • community/zabbix/changelogs/fragments/.gitkeep
  • community/zabbix/changelogs/.plugin-cache.yaml
  • community/zabbix/.github
  • community/zabbix/.gitignore
  • community/zabbix/.yamllint
  • containers/podman/docs/.nojekyll
  • containers/podman/tests/.gitignore
  • cyberark/conjur/.codeclimate.yml
  • cyberark/conjur/.github
  • cyberark/conjur/.gitignore
  • cyberark/conjur/roles/conjur_host_identity/tests/.dockerignore
  • cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache
  • cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/.gitignore
  • cyberark/conjur/tests/conjur_variable/.dockerignore
  • cyberark/conjur/tests/conjur_variable/.pytest_cache
  • cyberark/conjur/tests/conjur_variable/.pytest_cache/.gitignore
  • cyberark/pas/.github
  • cyberark/pas/.gitignore
  • dellemc/enterprise_sonic/changelogs/.plugin-cache.yaml
  • dellemc/enterprise_sonic/.github
  • dellemc/enterprise_sonic/.gitignore
  • dellemc/enterprise_sonic/.yamllint
  • dellemc/openmanage/.ansible-lint
  • dellemc/openmanage/changelogs/.plugin-cache.yaml
  • dellemc/openmanage/.github
  • dellemc/openmanage/.gitignore
  • dellemc/openmanage/roles/idrac_certificate/.yamllint
  • dellemc/openmanage/roles/idrac_export_server_config_profile/.yamllint
  • dellemc/openmanage/roles/idrac_gather_facts/.yamllint
  • dellemc/openmanage/roles/idrac_import_server_config_profile/.yamllint
  • dellemc/openmanage/roles/idrac_server_powerstate/.yamllint
  • dellemc/openmanage/tests/.gitignore
  • dellemc/powerflex/changelogs/.plugin-cache.yaml
  • dellemc/powerflex/.github
  • dellemc/unity/changelogs/.plugin-cache.yaml
  • dellemc/unity/.github
  • f5networks/f5_modules/changelogs/fragments/.gitkeep
  • f5networks/f5_modules/changelogs/.plugin-cache.yaml
  • f5networks/f5_modules/docs/.gitkeep
  • fortinet/fortimanager/changelogs/.plugin-cache.yaml
  • fortinet/fortios/changelogs/.plugin-cache.yaml
  • frr/frr/changelogs/.plugin-cache.yaml
  • frr/frr/.gitignore
  • frr/frr/.pre-commit-config.yaml
  • frr/frr/tests/.gitignore
  • frr/frr/.yamllint
  • gluster/gluster/.github
  • gluster/gluster/.gitignore
  • google/cloud/.ansible-lint
  • google/cloud/changelogs/.plugin-cache.yaml
  • google/cloud/.github
  • google/cloud/.gitignore
  • google/cloud/.gitmodules
  • google/cloud/.vscode
  • google/cloud/.yamllint
  • grafana/grafana/.ansible-lint
  • grafana/grafana/changelogs/.plugin-cache.yaml
  • grafana/grafana/.editorconfig
  • grafana/grafana/.github
  • grafana/grafana/.gitignore
  • grafana/grafana/.markdownlint.yaml
  • grafana/grafana/.shellcheckrc
  • grafana/grafana/.textlintrc
  • grafana/grafana/.yamllint
  • hetzner/hcloud/.azure-pipelines
  • hetzner/hcloud/changelogs/fragments/.keep
  • hetzner/hcloud/changelogs/.gitignore
  • hetzner/hcloud/.github
  • hetzner/hcloud/.gitignore
  • hetzner/hcloud/.gitlab-ci.yml
  • hetzner/hcloud/tests/.gitignore
  • hpe/nimble/.gitignore
  • ibm/qradar/.github
  • ibm/qradar/.gitignore
  • ibm/qradar/.pre-commit-config.yaml
  • ibm/qradar/tests/.keep
  • ibm/qradar/.yamllint
  • ibm/spectrum_virtualize/.github
  • ibm/spectrum_virtualize/.gitignore
  • infinidat/infinibox/.gitignore
  • infinidat/infinibox/.gitlab-ci.yml
  • infoblox/nios_modules/changelogs/.plugin-cache.yaml
  • infoblox/nios_modules/.github
  • infoblox/nios_modules/.gitignore
  • inspur/ispim/changelogs/fragments/.keep
  • inspur/ispim/changelogs/.plugin-cache.yaml
  • inspur/ispim/.github
  • inspur/sm/changelogs/.plugin-cache.yaml
  • inspur/sm/.github
  • junipernetworks/junos/changelogs/fragments/.keep
  • junipernetworks/junos/.github
  • junipernetworks/junos/.gitignore
  • junipernetworks/junos/.isort.cfg
  • junipernetworks/junos/.pre-commit-config.yaml
  • junipernetworks/junos/.prettierignore
  • junipernetworks/junos/tests/.gitignore
  • junipernetworks/junos/.yamllint
  • kubernetes/core/.github
  • kubernetes/core/.gitignore
  • kubernetes/core/.yamllint
  • lowlydba/sqlserver/changelogs/fragments/.keep
  • lowlydba/sqlserver/docs/.gitkeep
  • lowlydba/sqlserver/.github
  • lowlydba/sqlserver/tests/integration/.ansible-lint
  • lowlydba/sqlserver/.vscode
  • microsoft/ad/.azure-pipelines
  • microsoft/ad/changelogs/fragments/.keep
  • microsoft/ad/.github
  • microsoft/ad/.gitignore
  • netapp/aws/.github
  • netapp/azure/changelogs/.plugin-cache.yaml
  • netapp/azure/.github
  • netapp/cloudmanager/changelogs/.plugin-cache.yaml
  • netapp/cloudmanager/.github
  • netapp/elementsw/.github
  • netapp_eseries/santricity/changelogs/.plugin-cache.yaml
  • netapp_eseries/santricity/.gitignore
  • netapp_eseries/santricity/roles/nar_santricity_common/.travis.yml
  • netapp_eseries/santricity/roles/nar_santricity_management/.travis.yml
  • netapp/ontap/changelogs/.DS_Store
  • netapp/ontap/changelogs/.plugin-cache.yaml
  • netapp/ontap/.github
  • netapp/ontap/roles/na_ontap_vserver_delete/.travis.yml
  • netapp/ontap/tests/unit/plugins/modules/.pytest_cache
  • netapp/ontap/tests/unit/plugins/modules/.pytest_cache/.gitignore
  • netapp/storagegrid/.github
  • netapp/um_info/.github
  • netbox/netbox/changelogs/fragments/.gitkeep
  • netbox/netbox/.github
  • netbox/netbox/.gitignore
  • netbox/netbox/.readthedocs.yml
  • netbox/netbox/tests/integration/targets/inventory-v3.1/.gitignore
  • netbox/netbox/tests/integration/targets/inventory-v3.2/.gitignore
  • netbox/netbox/tests/integration/targets/inventory-v3.3/.gitignore
  • netbox/netbox/tests/integration/targets/inventory-v3.4/.gitignore
  • ngine_io/cloudstack/changelogs/fragments/.keep
  • ngine_io/cloudstack/changelogs/.gitignore
  • ngine_io/cloudstack/.github
  • ngine_io/cloudstack/.gitignore
  • ngine_io/exoscale/changelogs/fragments/.keep
  • ngine_io/exoscale/changelogs/.gitignore
  • ngine_io/exoscale/.github
  • ngine_io/vultr/changelogs/fragments/.keep
  • ngine_io/vultr/changelogs/.gitignore
  • ngine_io/vultr/.github
  • ngine_io/vultr/.gitignore
  • openvswitch/openvswitch/changelogs/.plugin-cache.yaml
  • openvswitch/openvswitch/.gitignore
  • openvswitch/openvswitch/tests/.gitignore
  • openvswitch/openvswitch/.yamllint
  • ovirt/ovirt/changelogs/fragments/.keep
  • ovirt/ovirt/.config
  • ovirt/ovirt/tests/.gitignore
  • purestorage/flasharray/changelogs/.plugin-cache.yaml
  • purestorage/flasharray/.git-blame-ignore-revs
  • purestorage/flasharray/.github
  • purestorage/flasharray/.gitignore
  • purestorage/flasharray/playbooks/files/.keep
  • purestorage/flasharray/playbooks/.keep
  • purestorage/flasharray/playbooks/tasks/.keep
  • purestorage/flasharray/playbooks/templates/.keep
  • purestorage/flasharray/playbooks/vars/.keep
  • purestorage/flasharray/.pylintrc
  • purestorage/flasharray/roles/.keep
  • purestorage/flashblade/changelogs/.plugin-cache.yaml
  • purestorage/flashblade/.git-blame-ignore-revs
  • purestorage/flashblade/.github
  • purestorage/flashblade/.gitignore
  • purestorage/flashblade/playbooks/files/.keep
  • purestorage/flashblade/playbooks/.keep
  • purestorage/flashblade/playbooks/tasks/.keep
  • purestorage/flashblade/playbooks/templates/.keep
  • purestorage/flashblade/playbooks/vars/.keep
  • purestorage/flashblade/.pylintrc
  • purestorage/flashblade/roles/.keep
  • purestorage/fusion/changelogs/.plugin-cache.yaml
  • purestorage/fusion/.github
  • purestorage/fusion/.gitignore
  • purestorage/fusion/playbooks/files/.keep
  • purestorage/fusion/playbooks/.keep
  • purestorage/fusion/playbooks/roles/.keep
  • purestorage/fusion/playbooks/tasks/.keep
  • purestorage/fusion/playbooks/templates/.keep
  • purestorage/fusion/playbooks/vars/.keep
  • sensu/sensu_go/.circleci
  • sensu/sensu_go/.flake8
  • sensu/sensu_go/.gitattributes
  • sensu/sensu_go/.github
  • sensu/sensu_go/.gitignore
  • servicenow/servicenow/changelogs/fragments/.keep
  • servicenow/servicenow/changelogs/.plugin-cache.yaml
  • servicenow/servicenow/.github
  • servicenow/servicenow/.gitignore
  • splunk/es/changelogs/fragments/.keep
  • splunk/es/.github
  • splunk/es/.gitignore
  • splunk/es/.pre-commit-config.yaml
  • splunk/es/tests/.keep
  • splunk/es/.yamllint
  • t_systems_mms/icinga_director/changelogs/.plugin-cache.yaml
  • t_systems_mms/icinga_director/docs/.gitkeep
  • t_systems_mms/icinga_director/.gitattributes
  • t_systems_mms/icinga_director/.gitignore
  • vmware/vmware_rest/.gitignore
  • vmware/vmware_rest/manual/source/.rstcheck.cfg
  • vmware/vmware_rest/tests/.gitignore
  • vmware/vmware_rest/tests/integration/targets/vcenter_vm_clone_on_library/.gitignore
  • vmware/vmware_rest/tests/integration/targets/vcenter_vm_cloning/.gitignore
  • vmware/vmware_rest/tests/integration/targets/vcenter_vm_customize/.gitignore
  • vultr/cloud/.ansible-lint
  • vultr/cloud/changelogs/fragments/.keep
  • vultr/cloud/changelogs/.gitignore
  • vultr/cloud/.github
  • vultr/cloud/.gitignore
  • vultr/cloud/.yamllint
  • vyos/vyos/changelogs/fragments/.keep
  • vyos/vyos/.github
  • vyos/vyos/.gitignore
  • vyos/vyos/.isort.cfg
  • vyos/vyos/.pre-commit-config.yaml
  • vyos/vyos/.prettierignore
  • vyos/vyos/tests/.gitignore
  • vyos/vyos/.yamllint

When restricting to dotfiles (and dot directories) outside of the collection root, there are 206 ones:

  • amazon/aws/changelogs/fragments/.keep
  • amazon/aws/tests/.gitignore
  • amazon/aws/tests/unit/plugins/modules/placebo_recordings/.gitkeep
  • ansible/netcommon/changelogs/fragments/.keep
  • ansible/netcommon/tests/.gitignore
  • ansible/posix/changelogs/fragments/.keep
  • ansible/posix/tests/.gitignore
  • ansible/utils/changelogs/fragments/.keep
  • ansible/windows/changelogs/fragments/.keep
  • ansible/windows/tests/.gitignore
  • arista/eos/changelogs/fragments/.keep
  • arista/eos/tests/.gitignore
  • check_point/mgmt/changelogs/.plugin-cache.yaml
  • chocolatey/chocolatey/changelogs/.plugin-cache.yaml
  • cisco/aci/changelogs/.gitignore
  • cisco/aci/changelogs/.plugin-cache.yaml
  • cisco/aci/tests/.gitignore
  • cisco/aci/tests/unit/module_utils/.pytest_cache
  • cisco/aci/tests/unit/module_utils/.pytest_cache/.gitignore
  • cisco/asa/changelogs/fragments/.keep
  • cisco/asa/tests/.gitignore
  • cisco/dnac/plugins/.DS_Store
  • cisco/ios/changelogs/fragments/.keep
  • cisco/ios/tests/.gitignore
  • cisco/iosxr/changelogs/fragments/.keep
  • cisco/iosxr/tests/.gitignore
  • cisco/ise/roles/personas_deployment/.travis.yml
  • cisco/meraki/changelogs/.plugin-cache.yaml
  • cisco/mso/changelogs/.gitignore
  • cisco/mso/changelogs/.plugin-cache.yaml
  • cisco/mso/tests/.gitignore
  • cisco/nso/changelogs/.plugin-cache.yaml
  • cisco/nxos/changelogs/fragments/.keep
  • cisco/nxos/tests/.gitignore
  • cisco/nxos/tests/integration/targets/nxos_prefix_lists/tests/common/.DS_Store
  • cisco/nxos/tests/integration/targets/nxos_prefix_lists/tests/.DS_Store
  • cloud/common/changelogs/fragments/.keep
  • cloudscale_ch/cloud/changelogs/fragments/.keep
  • cloudscale_ch/cloud/changelogs/.gitignore
  • community/aws/changelogs/fragments/.keep
  • community/aws/tests/.gitignore
  • community/aws/tests/unit/plugins/modules/placebo_recordings/.gitkeep
  • community/azure/changelogs/fragments/.keep
  • community/azure/tests/.gitignore
  • community/ciscosmb/changelogs/fragments/.keep
  • community/crypto/changelogs/fragments/.keep
  • community/crypto/tests/.gitignore
  • community/digitalocean/changelogs/fragments/.keep
  • community/digitalocean/changelogs/.gitignore
  • community/dns/changelogs/fragments/.keep
  • community/docker/changelogs/fragments/.keep
  • community/fortios/changelogs/fragments/.keep
  • community/general/changelogs/fragments/.keep
  • community/general/changelogs/.gitignore
  • community/general/tests/.gitignore
  • community/general/tests/integration/targets/django_manage/files/base_test/startproj/.keep
  • community/general/tests/integration/targets/terraform/.gitignore
  • community/google/changelogs/fragments/.keep
  • community/grafana/tests/.gitignore
  • community/hashi_vault/changelogs/fragments/.keep
  • community/hashi_vault/docs/preview/.gitignore
  • community/hashi_vault/tests/integration/.ansible-lint
  • community/hashi_vault/tests/integration/targets/setup_cert_content/files/.gitignore
  • community/hashi_vault/tests/integration/targets/setup_localenv_docker/files/.output
  • community/hashi_vault/tests/integration/targets/setup_localenv_docker/files/.output/.gitignore
  • community/hashi_vault/tests/integration/targets/setup_localenv_gha/files/.gitignore
  • community/hashi_vault/tests/integration/targets/setup_localenv_gha/files/.output
  • community/hrobot/changelogs/fragments/.keep
  • community/mongodb/changelogs/.plugin-cache.yaml
  • community/mongodb/roles/mongodb_auth/.yamllint
  • community/mongodb/roles/mongodb_config/.yamllint
  • community/mongodb/roles/mongodb_install/.yamllint
  • community/mongodb/roles/mongodb_mongod/.yamllint
  • community/mongodb/roles/mongodb_mongos/.yamllint
  • community/mongodb/roles/mongodb_repository/.yamllint
  • community/mongodb/roles/mongodb_selinux/.yamllint
  • community/mysql/changelogs/fragments/.keep
  • community/network/changelogs/fragments/.keep
  • community/network/changelogs/.gitignore
  • community/okd/changelogs/.plugin-cache.yaml
  • community/postgresql/changelogs/fragments/.keep
  • community/proxysql/roles/proxysql/.yamllint
  • community/routeros/changelogs/fragments/.keep
  • community/sap/changelogs/fragments/.keep
  • community/sap_libs/changelogs/fragments/.keep
  • community/skydive/tests/.gitignore
  • community/sops/changelogs/fragments/.keep
  • community/sops/tests/ee/roles/lookup_sops/files/.sops.yaml
  • community/sops/tests/integration/targets/filter_decrypt/files/.sops.yaml
  • community/sops/tests/integration/targets/load_vars/vars/.sops.yaml
  • community/sops/tests/integration/targets/lookup_sops/files/.sops.yaml
  • community/sops/tests/integration/targets/sops_encrypt/files/.sops.yaml
  • community/sops/tests/integration/targets/var_sops/.gitignore
  • community/sops/tests/integration/targets/var_sops/.sops.yaml
  • community/sops/tests/integration/targets/var_sops/test-stage-inv-cache/.gitignore
  • community/sops/tests/integration/targets/var_sops/test-stage-inv-no-cache/.gitignore
  • community/sops/tests/integration/targets/var_sops/test-stage-task-cache/.gitignore
  • community/sops/tests/integration/targets/var_sops/test-stage-task-no-cache/.gitignore
  • community/vmware/tests/.gitignore
  • community/windows/changelogs/fragments/.keep
  • community/windows/tests/.gitignore
  • community/windows/tests/integration/targets/win_lineinfile/files/expectations/.gitattributes
  • community/zabbix/changelogs/fragments/.gitkeep
  • community/zabbix/changelogs/.plugin-cache.yaml
  • containers/podman/docs/.nojekyll
  • containers/podman/tests/.gitignore
  • cyberark/conjur/roles/conjur_host_identity/tests/.dockerignore
  • cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache
  • cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/.gitignore
  • cyberark/conjur/tests/conjur_variable/.dockerignore
  • cyberark/conjur/tests/conjur_variable/.pytest_cache
  • cyberark/conjur/tests/conjur_variable/.pytest_cache/.gitignore
  • dellemc/enterprise_sonic/changelogs/.plugin-cache.yaml
  • dellemc/openmanage/changelogs/.plugin-cache.yaml
  • dellemc/openmanage/roles/idrac_certificate/.yamllint
  • dellemc/openmanage/roles/idrac_export_server_config_profile/.yamllint
  • dellemc/openmanage/roles/idrac_gather_facts/.yamllint
  • dellemc/openmanage/roles/idrac_import_server_config_profile/.yamllint
  • dellemc/openmanage/roles/idrac_server_powerstate/.yamllint
  • dellemc/openmanage/tests/.gitignore
  • dellemc/powerflex/changelogs/.plugin-cache.yaml
  • dellemc/unity/changelogs/.plugin-cache.yaml
  • f5networks/f5_modules/changelogs/fragments/.gitkeep
  • f5networks/f5_modules/changelogs/.plugin-cache.yaml
  • f5networks/f5_modules/docs/.gitkeep
  • fortinet/fortimanager/changelogs/.plugin-cache.yaml
  • fortinet/fortios/changelogs/.plugin-cache.yaml
  • frr/frr/changelogs/.plugin-cache.yaml
  • frr/frr/tests/.gitignore
  • google/cloud/changelogs/.plugin-cache.yaml
  • grafana/grafana/changelogs/.plugin-cache.yaml
  • hetzner/hcloud/changelogs/fragments/.keep
  • hetzner/hcloud/changelogs/.gitignore
  • hetzner/hcloud/tests/.gitignore
  • ibm/qradar/tests/.keep
  • infoblox/nios_modules/changelogs/.plugin-cache.yaml
  • inspur/ispim/changelogs/fragments/.keep
  • inspur/ispim/changelogs/.plugin-cache.yaml
  • inspur/sm/changelogs/.plugin-cache.yaml
  • junipernetworks/junos/changelogs/fragments/.keep
  • junipernetworks/junos/tests/.gitignore
  • lowlydba/sqlserver/changelogs/fragments/.keep
  • lowlydba/sqlserver/docs/.gitkeep
  • lowlydba/sqlserver/tests/integration/.ansible-lint
  • microsoft/ad/changelogs/fragments/.keep
  • netapp/azure/changelogs/.plugin-cache.yaml
  • netapp/cloudmanager/changelogs/.plugin-cache.yaml
  • netapp_eseries/santricity/changelogs/.plugin-cache.yaml
  • netapp_eseries/santricity/roles/nar_santricity_common/.travis.yml
  • netapp_eseries/santricity/roles/nar_santricity_management/.travis.yml
  • netapp/ontap/changelogs/.DS_Store
  • netapp/ontap/changelogs/.plugin-cache.yaml
  • netapp/ontap/roles/na_ontap_vserver_delete/.travis.yml
  • netapp/ontap/tests/unit/plugins/modules/.pytest_cache
  • netapp/ontap/tests/unit/plugins/modules/.pytest_cache/.gitignore
  • netbox/netbox/changelogs/fragments/.gitkeep
  • netbox/netbox/tests/integration/targets/inventory-v3.1/.gitignore
  • netbox/netbox/tests/integration/targets/inventory-v3.2/.gitignore
  • netbox/netbox/tests/integration/targets/inventory-v3.3/.gitignore
  • netbox/netbox/tests/integration/targets/inventory-v3.4/.gitignore
  • ngine_io/cloudstack/changelogs/fragments/.keep
  • ngine_io/cloudstack/changelogs/.gitignore
  • ngine_io/exoscale/changelogs/fragments/.keep
  • ngine_io/exoscale/changelogs/.gitignore
  • ngine_io/vultr/changelogs/fragments/.keep
  • ngine_io/vultr/changelogs/.gitignore
  • openvswitch/openvswitch/changelogs/.plugin-cache.yaml
  • openvswitch/openvswitch/tests/.gitignore
  • ovirt/ovirt/changelogs/fragments/.keep
  • ovirt/ovirt/tests/.gitignore
  • purestorage/flasharray/changelogs/.plugin-cache.yaml
  • purestorage/flasharray/playbooks/files/.keep
  • purestorage/flasharray/playbooks/.keep
  • purestorage/flasharray/playbooks/tasks/.keep
  • purestorage/flasharray/playbooks/templates/.keep
  • purestorage/flasharray/playbooks/vars/.keep
  • purestorage/flasharray/roles/.keep
  • purestorage/flashblade/changelogs/.plugin-cache.yaml
  • purestorage/flashblade/playbooks/files/.keep
  • purestorage/flashblade/playbooks/.keep
  • purestorage/flashblade/playbooks/tasks/.keep
  • purestorage/flashblade/playbooks/templates/.keep
  • purestorage/flashblade/playbooks/vars/.keep
  • purestorage/flashblade/roles/.keep
  • purestorage/fusion/changelogs/.plugin-cache.yaml
  • purestorage/fusion/playbooks/files/.keep
  • purestorage/fusion/playbooks/.keep
  • purestorage/fusion/playbooks/roles/.keep
  • purestorage/fusion/playbooks/tasks/.keep
  • purestorage/fusion/playbooks/templates/.keep
  • purestorage/fusion/playbooks/vars/.keep
  • servicenow/servicenow/changelogs/fragments/.keep
  • servicenow/servicenow/changelogs/.plugin-cache.yaml
  • splunk/es/changelogs/fragments/.keep
  • splunk/es/tests/.keep
  • t_systems_mms/icinga_director/changelogs/.plugin-cache.yaml
  • t_systems_mms/icinga_director/docs/.gitkeep
  • vmware/vmware_rest/manual/source/.rstcheck.cfg
  • vmware/vmware_rest/tests/.gitignore
  • vmware/vmware_rest/tests/integration/targets/vcenter_vm_clone_on_library/.gitignore
  • vmware/vmware_rest/tests/integration/targets/vcenter_vm_cloning/.gitignore
  • vmware/vmware_rest/tests/integration/targets/vcenter_vm_customize/.gitignore
  • vultr/cloud/changelogs/fragments/.keep
  • vultr/cloud/changelogs/.gitignore
  • vyos/vyos/changelogs/fragments/.keep
  • vyos/vyos/tests/.gitignore

@gotmax23
Copy link
Contributor

Thanks for working on this!

Maybe it would be easier to simply remove all dotfiles everywhere.

I'd like to do that, but I worry it'll break things. For example, I have a role that installs dotfiles on my systems and all of the templates/files start with a dot. However, scrolling through the list above, I don't see anything that looks important.

FWIW, we have a hard coded list of dotfiles that we always in remove in the Fedora package (https://src.fedoraproject.org/rpms/ansible/blob/rawhide/f/ansible.spec#_101). I tried to remove this when we started excluding tests and dotfiles from the wheels upstream, but as you showed, there's still a fair amount of dotfiles in other directories. Maybe we could use this list to exclude dotfiles from other directories (i.e. not the top level where we exclude everything) in the setup.py.

@felixfontein
Copy link
Collaborator Author

The latest change adds back ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.dockerignore, but not ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/.

I generated a hypothetical 8.0.0 with both the main branch and this branch, and the only differences in the wheel where that this branch has these files missing:

< ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/CACHEDIR.TAG
< ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/.gitignore
< ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/README.md
< ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/v/cache/nodeids
< ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/v/cache/stepwise
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/100-prefix_lists-resource-module.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/101-bgp-prefix_lists.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/102-playbook-example-updates.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/103-standard-interface-naming-and-other-bugfixes.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/105-vxlan-regression-test-fix.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/2.0.0.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/53-oc-yang-compliance.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/58-vxlan-primary-ip.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/60-bgp-regression-test_fixes.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/62-bgp-vxlan-primary-ip.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/63-bgp_af-route_advertise_list.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/67-bgp_neighbors-auth_pwd-and-neighbor_description.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/72-bgp_neighbors-add-attributes.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/76-CLI-command-prompt-answer-fix.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/78-aaa-regression-fix.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/81-add-bgp-peer-group-attributes.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/82-static_routes.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/85-regression-test-fixes.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/88-port_breakout-and-execution-environment.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/90-aaa-and-users-bugfix.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/98-vlans-description.yaml
< ansible_collections/dellemc/enterprise_sonic/changelogs/archive_fragments/2.0.0/99-ntp-resource-module.yaml

I guess the problem with the 2.0.0 folder is that 2.0.0 is not a valid Python identifier, but 🤷

@felixfontein
Copy link
Collaborator Author

Ok, this finally works! It produces almost the same files that are included as the version in the main branch - but this branch is actually more correct: it removes some files that should not be there, that are there in the main branch:

8097a8098,8102
> ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/CACHEDIR.TAG
> ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/.gitignore
> ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/README.md
> ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/v/cache/nodeids
> ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/.pytest_cache/v/cache/stepwise

So from my POV, this is now ready for review!

(Since Ansible 8.0.0a1 is due soon, we shouldn't wait for too long if we want this to be in 8.0.0.)

@felixfontein felixfontein marked this pull request as ready for review April 4, 2023 19:34
@gotmax23
Copy link
Contributor

gotmax23 commented Apr 4, 2023

Thanks! I'll take a closer look later.

@felixfontein
Copy link
Collaborator Author

I noticed that os.listdir() also lists files and not just directories (I should have known that, but I must have ignored that yesterday), and that the exclude_package_datas are probably no longer necessary. After testing both changes (they result in exactly the same file list) I've also pushed them.

Copy link
Contributor

@gotmax23 gotmax23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits:

src/antsibull/build_ansible_commands.py Outdated Show resolved Hide resolved
src/antsibull/build_ansible_commands.py Show resolved Hide resolved
Copy link
Contributor

@gotmax23 gotmax23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I had one final suggestion. I'd like to do one more test build later today when I'm on a more stable internet connection, and then we should be good to merge and cut a release.

Comment on lines 592 to 604
# Collect collection namespaces and collection root subdirectories
collection_namespaces: dict[str, list[str]] = defaultdict(list)
collection_directories: dict[str, list[str]] = {}
for collection in dependency_data.deps:
namespace, name = collection.split('.', 1)
collection_namespaces[namespace].append(name)
collection_path = os.path.join(ansible_collections_dir, namespace, name)
collection_directories[collection] = [
file for file in os.listdir(collection_path)
if file not in ('tests', 'docs')
and not file.startswith('.')
and os.path.isdir(os.path.join(collection_path, file))
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: you could try moving this to a function that returns a tuple of collection_names, collection_namespaces, collection_directories to reduce the mccabe complexity.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved a slightly different block out: f63694b.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it!

src/antsibull/build_ansible_commands.py Outdated Show resolved Hide resolved
src/antsibull/build_ansible_commands.py Show resolved Hide resolved
@gotmax23
Copy link
Contributor

gotmax23 commented Apr 7, 2023

and then we should be good to merge and cut a release.

I'd be happy to help cut the release and learn the process, but I don't think I have the permissions for that.

@felixfontein
Copy link
Collaborator Author

Do you have permissions to push to main directly? If yes, you should be able to do it.

But we can try to do it together; I'm not sure whether I'll have time later today but tomorrow should be ok.

@gotmax23
Copy link
Contributor

gotmax23 commented Apr 7, 2023

I think I can push to main, but I don't have access to the PyPI package.

Copy link
Contributor

@gotmax23 gotmax23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack. Thank you for working on this!

@gotmax23 gotmax23 merged commit d5a8e50 into ansible-community:main Apr 7, 2023
@felixfontein felixfontein deleted the improve-setuptools-2 branch April 7, 2023 20:42
@felixfontein
Copy link
Collaborator Author

I think I can push to main, but I don't have access to the PyPI package.

Well, looks like your invite expired, since you didn't accept it. I'll try to re-send it.

@felixfontein
Copy link
Collaborator Author

@gotmax23 thanks for testing, reviewing, and merging, and of course also working on this! :)

@gotmax23
Copy link
Contributor

gotmax23 commented Apr 7, 2023

Well, looks like your invite expired, since you didn't accept it. I'll try to re-send it.

Doh, it seems I completely missed those emails :). I've accepted the new ones. Thanks. I plan to release 0.55.0 tomorrow morning (it's midnight here now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecation warnings when building ansible with setuptools-62.6.0
2 participants