gorilla-co / s3pypi

CLI tool for creating a Python Package Repository in an S3 bucket.
https://novemberfive.co/blog/opensource-pypi-package-repository-tutorial/
MIT License
324 stars 85 forks source link

Adding ability to recurse a dist dir #89

Closed jaustinpage closed 2 years ago

jaustinpage commented 2 years ago

This is another way to address https://github.com/gorilla-co/s3pypi/issues/88

jaustinpage commented 2 years ago

I think being able to use tox and upload to s3 in a cross platform native python way is worth the extra lines of code. Let me know if you would like me to add documentation to how to use s3pypi in tox with example config, or if you would like to see better test coverage for this change, or what other improvements I might be able to make.

jaustinpage commented 2 years ago

I see how this could be beneficial in environments without shell expansion, but I'm also hesitant. What if someone writes s3pypi foo/* expecting this to go only one level deep, like most shell commands would? Am I being paranoid?

This is a good point. Let me see if i can come up with a way to address shell expansion having already explored a directory in a clean way.

jaustinpage commented 2 years ago

I see how this could be beneficial in environments without shell expansion, but I'm also hesitant. What if someone writes s3pypi foo/* expecting this to go only one level deep, like most shell commands would? Am I being paranoid?

This is a good point. Let me see if i can come up with a way to address shell expansion having already explored a directory in a clean way.

we could add a --dir option, that allows you to specify a directory, and leave the existing args behavior as is.

jaustinpage commented 2 years ago

oops, accidentally closed this, mea culpa.

mdwint commented 2 years ago

we could add a --dir option, that allows you to specify a directory, and leave the existing args behavior as is.

That sounds reasonable. What do you think of calling it -r, --recursive (a boolean flag)?

jaustinpage commented 2 years ago

we could add a --dir option, that allows you to specify a directory, and leave the existing args behavior as is.

That sounds reasonable. What do you think of calling it -r, --recursive (a boolean flag)?

I am on board 100%. Ill get to work on it.

jaustinpage commented 2 years ago

ok, one of these days I am going to figure out how to not close the silly pr. very sorry for the email spam

jaustinpage commented 2 years ago

we could add a --dir option, that allows you to specify a directory, and leave the existing args behavior as is.

That sounds reasonable. What do you think of calling it -r, --recursive (a boolean flag)?

If we use a -r --recursive, should it go infinitely deep?

mdwint commented 2 years ago

If we use a -r --recursive, should it go infinitely deep?

Sure, that's the most obvious behaviour given the name. I guess in practice deep recursion won't be needed much, and if I understand correctly you only need it for a single level, right?

jaustinpage commented 2 years ago

Hey, I had a realization. Because Tox is not auto-expanding the command line, we can just handle that specific case. We know that the file will come in as a non-existant file, since it is a file pattern. I am going to open a new pull request to look at this option and discuss.

jaustinpage commented 2 years ago

We should probably see if we like https://github.com/gorilla-co/s3pypi/pull/90 more than this pull request. If so, then we can close this one.

jaustinpage commented 2 years ago

closing in favor of #90