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

Turn img2braille into a package #3

Open
GideonBear opened this issue Dec 12, 2022 · 5 comments · Fixed by #6 · May be fixed by #7
Open

Turn img2braille into a package #3

GideonBear opened this issue Dec 12, 2022 · 5 comments · Fixed by #6 · May be fixed by #7
Labels
enhancement New feature or request

Comments

@GideonBear
Copy link
Contributor

This will simplify the installation process to python3 -m pip install img2braille
The img2braille name is free on PyPI

Are you okay with me submitting some pull requests for this project? (e.g. making it a package, adding tests, enforcing PEP8, making a main function, using built-in argparse features instead of manual or statements, maybe more)

@TheFel0x
Copy link
Owner

Of course, I'm very glad about pull requests.
Also I apologize for taking this long to reply.

@TheFel0x
Copy link
Owner

Since the img2braille pip package doesn't exist yet I should probably reopen this.
I haven't published a package using pip before so unfortunately I don't know the process yet. I will look into it however.

@TheFel0x TheFel0x reopened this Jan 15, 2023
@TheFel0x TheFel0x added the enhancement New feature or request label Jan 15, 2023
@GideonBear
Copy link
Contributor Author

I haven't published a package using pip before so unfortunately I don't know the process yet.

@TheFel0x I built and published packages before, if you want I can publish it for you / teach you how to do it.

@GideonBear GideonBear linked a pull request Jan 16, 2023 that will close this issue
4 tasks
@TheFel0x
Copy link
Owner

if you want I can publish it for you / teach you how to do it.
@GideonBear It would be great if you could teach me how to do so!

@GideonBear
Copy link
Contributor Author

GideonBear commented Jan 20, 2023

It would be great if you could teach me how to do so!

https://packaging.python.org/en/latest/flow/
First you need to make a PyPI account.
Then for each version you want to release:
Tag a version in git (git tag v0.0.1), I've set it up so it'll autodetect the version from git.
Then run these commands:

rm -r venv dist *.egg-info   # Cleanup
python3 -m venv venv   # Create venv
source venv/bin/activate   # Activate venv
pip install -U pip setuptools wheel   # Update venv
pip install -U build twine   # Install packages needed to build and upload
python -m build   # Build sdist and wheel
twine upload dist/*   # Upload to PyPI (enter username and password)
rm -r venv dist *.egg-info   # cleanup

I have lots of aliases, so for me it's just buildpub:

alias buildcleanup='rm -r venv dist *.egg-info'
alias buildpub='buildcleanup ; mkv && pip install -U build twine && python -m build && twine upload dist/* && buildcleanup'
function mkv {
    $python -m venv venv
    av
    pip install -U pip setuptools wheel
    # More stuff to automatically install requirements files
}
alias av='source venv/bin/activate'
alias dv='deactivate'
alias rv='rm -r venv'

Then people can install it using python3 -m pip install img2braille and run it using img2braille.

I'm going to test this on https://test.pypi.org first, to make sure the whole process works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants