apache / horaedb-client-py

Apache HoraeDB (Incubating) Python Client.
https://horaedb.apache.org/
Apache License 2.0
9 stars 6 forks source link

Support uploading package to pypi #11

Closed ShiKaiWi closed 2 years ago

ShiKaiWi commented 2 years ago

To deliver the sdk to users, We have to upload the package to pypi. What we should do:

Maybe we should refer to some other famous python project.

ShiKaiWi commented 2 years ago

@messense Would you like provide some suggestions?

messense commented 2 years ago

https://github.com/CeresDB/ceresdb-client-py/blob/02719e2a7d70a3bd0bb183f965b2ab52b3e3b0f8/.github/workflows/release.yml#L47-L65

It's already there, but you need to configure the PYPI_TOKEN secret. Push a tag will trigger it.

messense commented 2 years ago

I wonder if we should rename the Python package name to ceresdb_client, the _py suffix is redundant. It's much nicer to write import ceresdb_client instead of import ceresdb_client_py.

ShiKaiWi commented 2 years ago

I wonder if we should rename the Python package name to ceresdb_client, the _py suffix is redundant. It's much nicer to write import ceresdb_client instead of import ceresdb_client_py.

Actually, ceresdb_client_py is just the name of this repository and the package name should be ceresdb_client.

ShiKaiWi commented 2 years ago

I find that now the project name is ceresdb_client_py and I will fix it: https://github.com/CeresDB/ceresdb-client-py/blob/02719e2a7d70a3bd0bb183f965b2ab52b3e3b0f8/pyproject.toml#L2

messense commented 2 years ago

It's more than that name change, I'll send a PR soon.

Edit: https://github.com/CeresDB/ceresdb-client-py/pull/12

messense commented 2 years ago

To get a pypi api token for this project, you can run maturin sdist -o dist locally (you can change the version in Cargo.toml to 0.0.0 first because we may not want to ship a v0.1.0 right now) and upload dist/*.tar.gz file using twine to register the package under your PyPI account. After that you can generate a new api token for this project in pypi.org dashboard.

maturin sdist -o dist
pip3 install twine
twine upload dist/*.tar.gz
ShiKaiWi commented 2 years ago

To get a pypi api token for this project, you can run maturin sdist -o dist locally (you can change the version in Cargo.toml to 0.0.0 first because we may not want to ship a v0.1.0 right now) and upload dist/*.tar.gz file using twine to register the package under your PyPI account. After that you can generate a new api token for this project in pypi.org dashboard.

maturin sdist -o dist
pip3 install twine
twine upload dist/*.tar.gz

I'm registering pypi account.

ShiKaiWi commented 2 years ago

Already upload version 0.0.0 client: https://pypi.org/project/ceresdb-client/. and we are preparing to release 0.1.0 after #13 merged.

Thanks for your guidance. @messense