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

Produce a source distribution file to pypi (tar.gz format) #61

Closed
ChrisCarini opened this issue Dec 1, 2020 · 16 comments · Fixed by #66
Closed

Produce a source distribution file to pypi (tar.gz format) #61

ChrisCarini opened this issue Dec 1, 2020 · 16 comments · Fixed by #66
Labels
DevOps Development operation related items. help wanted

Comments

@ChrisCarini
Copy link

Is your feature request related to a problem? Please describe.
In some corporate environments, it's common to import external libraries into an internal repository for internal dependency resolution. In order to import matrixprofile for use, a tar.gz file is needed similar to the python libraries requests or pytest.

Describe the solution you'd like
A tar.gz file uploaded to pypi as part of the release. See requests or pytest as examples. Links below.

Describe alternatives you've considered
None.

Additional context

@tylerwmarrs tylerwmarrs added DevOps Development operation related items. help wanted labels Dec 1, 2020
@tylerwmarrs
Copy link
Contributor

tylerwmarrs commented Dec 1, 2020

Thank you for raising this issue. The packages distributed on PyPi are currently binary wheels to avoid complications with dependencies during installation. A "tar.gz" deployment is distributing the source code. It is my understanding that some companies prefer to have the "tar.gz" file purely to execute some vulnerability scanning on the code. The "tar.gz" is the older way of distributing a library using "sdist" instead of the newer "wheel" format. See https://www.python.org/dev/peps/pep-0427/#id5

The two packages that you linked can easily distribute source code and installation is simplistic. This is because they are using pure Python while our library also uses Cython for speed reasons. Numpy is in a similar situation as us where the installation may be cumbersome for end-users when distributing source code. However, they do provide their source code as a ".zip".

image

Do you know if a ".zip" is suitable for your employer or is the older sdist (.tar.gz) source required?

For your reference, our documentation shows how to install from source on various operating systems:
https://matrixprofile.docs.matrixprofile.org/install.html

@tylerwmarrs
Copy link
Contributor

@ChrisCarini are you able to provide more insight?

@ChrisCarini
Copy link
Author

Hey @tylerwmarrs - apologies, I missed the notification for your first detailed (thank you, by the way! :) ) response.

I'm confirming on the .zip vs .tar.gz - I believe a .zip should be fine, but am waiting on confirmation.

I do know my employer is getting support soon for consuming the wheel format, however, it will require a longer process to bring in, as it will require our company to manually sign off from a legal and security perspective (whereas, this process is simplified / more automated for sdists).

For the time being, I can manually pull this in for experimenting locally - let me get back to you regarding the .zip vs .tar.gz though!

And, thank you again for the detail above, python packaging is a bit out of my wheelhouse (see what I did there?! ha ha), so this helps me get more familiar with it!

@tylerwmarrs
Copy link
Contributor

@ChrisCarini did you determine if the zip file works for your employer? Either way, I think we should probably add the source distribution as described above.

@ChrisCarini
Copy link
Author

Hi @tylerwmarrs - confirmed with my employer, so long as it is a sdist, we should be able to bring it in for use.

We are working on a way to bring in wheels, although that is not as automated, yet (it requires manual approvals from our security and legal teams).

@tylerwmarrs
Copy link
Contributor

@ChrisCarini thank you for figuring this out. I'll update the title to reflect the need for a "zip" file.

@tylerwmarrs tylerwmarrs changed the title Produce a tar.gz file to pypi Produce a source distribution file to pypi (zip format) Dec 23, 2020
@ChrisCarini
Copy link
Author

Thank you! And happy holidays!

@tylerwmarrs
Copy link
Contributor

@ChrisCarini happy holidays!

@lmmentel this is another easy one if you have time. :)

@lmmentel
Copy link
Contributor

Sure, it is actually possible to have both ".tar.gz" and ".zip" according to the docs. I can add both options to travis build.

@tylerwmarrs
Copy link
Contributor

I started working on this myself as I found time to do it. :) It probably makes sense for me to tackle it since I have ownership of the TravisCI etc.

@tylerwmarrs
Copy link
Contributor

@lmmentel you actually can only upload one archive type to PyPi. See screenshot:
image

@lmmentel
Copy link
Contributor

I didn't know PyPI had this limitation. Do you want me to update the PR or you want to take it from here?

@tylerwmarrs
Copy link
Contributor

I got it. Thanks for your help today! I only have to work a half day today and was going to tackle some of these "easy" issues. It is always nice to have help!

@tylerwmarrs tylerwmarrs changed the title Produce a source distribution file to pypi (zip format) Produce a source distribution file to pypi (tar.gz format) Dec 23, 2020
@lmmentel
Copy link
Contributor

Glad to be useful.

I guess I thought that PyPI is more like github releases allowing multiple source formats.

image

BTW @ChrisCarini any reason you couldn't use source distributions released on github?

@ChrisCarini
Copy link
Author

Wow, that was a fast turn around! Thank you!!

@lmmentel - our internal process for python is automated from pypi. Manually bringing in other source releases from GitHub release would require similar manual security / legal review, unfortunately. Having it on pypi makes it much easier both to get started, and when we want to bring in the latest releases.

@lmmentel
Copy link
Contributor

Got it, thanks for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DevOps Development operation related items. help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants