-
Notifications
You must be signed in to change notification settings - Fork 31
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
Work around setuptools 63 deprecations #502
Conversation
Ok, there is one problem: dotfiles in subdirectories of docs/ or tests/ are kept as well. |
Aaand I was able to solve that one by adding:
this gets rid of all (Don't ask me how I figured that out... resp. how many combinations I tried...) |
Hmm, while that works, I noticed another problem: subdirectories further down in the tree that are called |
The thing is that setuptools's |
I was able to work around these problems by avoiding wildcards if possible, but some files are still removed from the wheel, for example:
while these are files we actually don't want to have in the wheel, this could have also hit other files like |
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.
When restricting to dotfiles (and dot directories) outside of the collection root, there are 206 ones:
|
Thanks for working on this!
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 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. |
The latest change adds back I generated a hypothetical 8.0.0 with both the
I guess the problem with the |
Ok, this finally works! It produces almost the same files that are included as the version in the
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.) |
Thanks! I'll take a closer look later. |
I noticed that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits:
There was a problem hiding this 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.
# 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)) | ||
] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it!
I'd be happy to help cut the release and learn the process, but I don't think I have the permissions for that. |
Do you have permissions to push to But we can try to do it together; I'm not sure whether I'll have time later today but tomorrow should be ok. |
I think I can push to |
There was a problem hiding this 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!
Well, looks like your invite expired, since you didn't accept it. I'll try to re-send it. |
@gotmax23 thanks for testing, reviewing, and merging, and of course also working on this! :) |
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). |
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+.