scribe-org / Scribe-Data

Wikidata, Wiktionary and Wikipedia language data extraction
GNU General Public License v3.0
23 stars 25 forks source link

Scribe-Data pip to usable CLI deployment #149

Open andrewtavis opened 3 months ago

andrewtavis commented 3 months ago

Terms

Description

This issue would investigate and do a deployment of Scribe-Data toPyPI such that when the package is installed it's directly accessible as a CLI. We'll use this issue first to do some research on how best to do this, and once it's done we can implement the decided on changes that need to be made :)

Contribution

@mhmohona will be working on this as a part of GSoC 2024 β˜€οΈ Please write in here so I can assign, and let us know how we can support with research and implementation!

mhmohona commented 3 months ago

After pip, I want to work on conda package as well.

andrewtavis commented 3 months ago

I'll make an issue for that as well! We need to think about a unified way of deployment though, as we're talking four different directories now. Might be nice if we made an action for that that would use some secrets to do the deployments to each :)

andrewtavis commented 3 months ago

I think that this issue could potentially be done, @mhmohona, but we'll have to see post deployment if your change of...

    entry_points={
        "console_scripts": [
            "scribe-data=scribe_data.cli.main:main",
        ],
    }

... works after the next deployment :) Let's give this a check once we've released and we can then try to pip install and check if the CLI works! Hope so!

mhmohona commented 2 months ago

I am going through the official documentation for submitting package for PyPI. For this they suggested to upload our package in Test PyPI first, and then in actual PyPI. Then let me upload it in Test PyPI first, and I will let know how things go.

andrewtavis commented 2 months ago

Hey @mhmohona πŸ‘‹ I think that ultimately we should have most of this done right now :) Scribe-Data already is on pip. The only question is whether the user will be able to use it directly after pip installing it :)

We didn't yet give you direction on next steps... Issues I'd suggest would be:

andrewtavis commented 2 months ago

As far as this issue is concerned, we'll basically just check to see if it works after the next release, and if it does we'll close this, and if not we'll go back to the drawing board 😊

mhmohona commented 2 months ago

Great! Thank you.

Another thing is we should implement test for CLI, shouldn't we? Will you please guide me regarding it?

andrewtavis commented 2 months ago

Sure thing, we can definitely discuss this in the next sync! I'll make the issue to document the CLI :)

andrewtavis commented 2 months ago

165 was made for the usage documentation, @mhmohona :)

mhmohona commented 2 months ago

So I just checked for this part -

The only question is whether the user will be able to use it directly after pip installing it :)

no, it doesnt work. :( I mean the in a fresh device, after installing scribe-data, scribe-data list command doesnt work yet. Then there is still I need to work on.

andrewtavis commented 2 months ago

Hey @mhmohona πŸ‘‹ We haven't deployed the new changes yet, so it wouldn't work yet :) When you pip install Scribe-Data now you're getting the currently deployed version 3.3, which doesn't have any of the CLI changes. Once we document it a bit, we should be good to do a release and see if this works. Specifically as well, we need to document and do #165 before this one, as what it is that we put in the readme is what's going to be on the PyPI page for Scribe-Data until we release again - i.e. we can't edit the PyPI documentation itself, it can only be done during a release. We can of course do a patch release to fix some things on PyPI though 😊

mhmohona commented 2 months ago

Oh alright. Got it. Thank you so much for explaining all the details. Just one more thing, when you are saying we haven't deployed it yet, do you mean it hasn't been deployed in Docker?

andrewtavis commented 2 months ago

I means it hasn't been deployed to PyPI :) We can even deploy together when the time comes, if you'd like to see how it works, but here are the steps I follow when I deploy Scribe-Data to PyPI:

# Change the version number inΒ setup.py and conf.py in the docs.
# So in this case we'd change it to 4.0.0.
# Run setup file again to build for deployment:
python setup.py bdist_wheel
# Run twine to upload, and indicate that we should only upload the most recent version:
twine upload --skip-existing dist/*
User name: __token__  # we actully enter __token__ to tell it we're using an upload token
Password: MY_API_KEY  # the API key I have for PyPI

Let me know if you have further questions! Would be happy to do the deployment in a sync or another call so you can see how it's done, if that would be of interest 😊

mhmohona commented 2 months ago

That would be really great!