neurostatslab / tensortools

A very simple and barebones tensor decomposition library for CP decomposition a.k.a. PARAFAC a.k.a. TCA
MIT License
160 stars 65 forks source link

Adds deploy action #38

Closed billbrod closed 1 year ago

billbrod commented 1 year ago

This PR adds deploy.yml, which will deploy the package to pypi when you publish a github release. It requires two things:

Finally, I also added long_description to your setup.py. This was necessary for me to deploy my package correctly, though there might be a work-around. It just makes your readme show up on the pypi page, which I figure is worth doing.

You probably should test this first, in which case, see the guide linked earlier about how to publish to test.pypi.org instead.

Let me know if you have any issues!

billbrod commented 1 year ago

I also added ci.yml, which runs pytest tests/ in python 3.7 through 3.10 weekly, on PRs to main, when you push to main, and whenever you want to dispatch it. You can edit the values in the top of the file to change that. (they won't run on your version until you merge this, but you can see them on my fork).

I also removed requirements.txt (it wasn't being used and is redundant with what you have in setup.py) and modified setup.py: I removed test_require and setup_require, since the first is deprecated the second is discouraged, and neither are used (setuptools docs). I also added matplotlib to install_require, since you use it in several places (and it's necessary for tests). If you'd rather have that be optional, I can just install it for tests and we can add something to readme saying when it should be installed.

Finally, I added a link to documentation in setup.py, so it will show up on the pypi page. You should also add it on the github page. I'd recommend it as the website in the About section (I added this for mine, but I'm pretty sure this doesn't get included in the PR)