sharkdp / shell-functools

Functional programming tools for the shell
MIT License
1.2k stars 49 forks source link

Suggestion to create a pypi package for this #13

Closed franklingu closed 6 years ago

franklingu commented 6 years ago

for #11

franklingu commented 6 years ago
(.venv) jgu@jgu-pc:~/self_repos/shell-functools (master%=) % pip uninstall ft
Uninstalling ft-1.0.0:
  /home/jgu/self_repos/shell-functools/.venv/bin/filter
  /home/jgu/self_repos/shell-functools/.venv/bin/foldl
  /home/jgu/self_repos/shell-functools/.venv/bin/ft-functions
  /home/jgu/self_repos/shell-functools/.venv/bin/map
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft-1.0.0-py3.6.egg-info
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__init__.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/__init__.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/command.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/error.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/functions.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/internal.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/termcolor.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/test_command.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/types.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/command.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/__init__.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/__pycache__/__init__.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/__pycache__/filter.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/__pycache__/foldl.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/__pycache__/map.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/filter.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/foldl.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/map.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/error.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/functions.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/internal.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/termcolor.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/test_command.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/types.py
Proceed (y/n)? y
  Successfully uninstalled ft-1.0.0
(.venv) jgu@jgu-pc:~/self_repos/shell-functools (master%=) % pip install .   
Processing /home/jgu/self_repos/shell-functools
Installing collected packages: ft
  Running setup.py install for ft ... done
Successfully installed ft-1.0.0

Example of running pip install .

franklingu commented 6 years ago

Issues to think about: how to do versioning? maybe use ft.version as the version in setup.py what versions of python to support? I suggest this repo should have ci from travis -- I can make a separate PR for this one and verify builds across multiple python versions. I tested python 3.6 and 3.5. Not sure about others more metadata to be added in setup? I am not sure about this

sharkdp commented 6 years ago

how to do versioning? maybe use ft.version as the version in setup.py

How do other pip packages handle this? I'm okay with adding a new python file somewhere that includes the __version__ (or include it in an existing file).

what versions of python to support? I suggest this repo should have ci from travis -- I can make a separate PR for this one and verify builds across multiple python versions.

That sounds great.

I tested python 3.6 and 3.5. Not sure about others

I'd be okay with that for now.

more metadata to be added in setup? I am not sure about this

I can take a look once this is merged.

franklingu commented 6 years ago
(.venv) jgu@jgu-pc:~/self_repos/shell-functools (master>) % pip install .                
Processing /home/jgu/self_repos/shell-functools
Installing collected packages: shell-functools
  Running setup.py install for shell-functools ... done
Successfully installed shell-functools-0.2.0
(.venv) jgu@jgu-pc:~/self_repos/shell-functools (master>) % pip uninstall shell-functools
Uninstalling shell-functools-0.2.0:
  /home/jgu/self_repos/shell-functools/.venv/bin/filter
  /home/jgu/self_repos/shell-functools/.venv/bin/foldl
  /home/jgu/self_repos/shell-functools/.venv/bin/ft-functions
  /home/jgu/self_repos/shell-functools/.venv/bin/map
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__init__.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/__init__.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/command.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/error.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/functions.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/internal.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/termcolor.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/test_command.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/__pycache__/types.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/command.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/__init__.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/__pycache__/__init__.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/__pycache__/filter.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/__pycache__/foldl.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/__pycache__/map.cpython-36.pyc
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/filter.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/foldl.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/commands/map.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/error.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/functions.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/internal.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/termcolor.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/test_command.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/ft/types.py
  /home/jgu/self_repos/shell-functools/.venv/lib/python3.6/site-packages/shell_functools-0.2.0-py3.6.egg-info
Proceed (y/n)? y
  Successfully uninstalled shell-functools-0.2.0
franklingu commented 6 years ago

This is working on #12 as well

sharkdp commented 6 years ago

Thanks!

franklingu commented 6 years ago

maybe you can create tags now for this repo

franklingu commented 6 years ago

https://packaging.python.org/tutorials/distributing-packages/#uploading-your-project-to-pypi

you can take a look at this and upload the package to pypi and publish it!

sharkdp commented 6 years ago

Thank you for the link.

The package has been uploaded to pypi.