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

How to install issue? #10

Open
jeffofx opened this issue Sep 20, 2021 · 2 comments
Open

How to install issue? #10

jeffofx opened this issue Sep 20, 2021 · 2 comments

Comments

@jeffofx
Copy link

jeffofx commented Sep 20, 2021

Preface: First of all, I realize that, if I need to ask how to install issue form source, there is a non-zero chance that I shouldn't be using issue. '...for programmers...', right? Well, a noob is still a programmer, so.... But I have never installed someone else's Python app from source. Yes, I have read all the /doc files, and the README, and Googled a lot. I must have missed the answer. (Also: In my various attempts, I have not used virtualenv or similar, though I understand how and why to use venvs with Python. My reasoning is that I will (I hope) be running the "issue" command as I would run any other command in Bash, not starting a venv, typing "python[/3] issue" or whatever.)

Here's my best attempt:

In

MacOS 11.6 (Big Sur)
bash (GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20))
directory: /usr/local/bin

I run ...

$ git clone https://github.com/marekjm/issue.git

And get back:

Cloning into 'issue'...
remote: Enumerating objects: 1532, done.
remote: Counting objects: 100% (75/75), done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 1532 (delta 49), reused 56 (delta 34), pack-reused 1457
Receiving objects: 100% (1532/1532), 360.84 KiB | 46.00 KiB/s, done.
Resolving deltas: 100% (982/982), done.

I cd into the issue/ directory:

issue $ pwd
/usr/local/bin/issue

Then, I check for dependencies, based on the README.markdown, which says:

Dependencies

Issue requires a recent version of Python 3 (any above 3.6 should be good).
Libraries:
CLAP: at least 0.15.0 (must be installed from Git)

  • unidecode: at least 1.0.23
  • colored: at least 1.3.93 (optional; provides colorisation)

I (sanity) check my Python:

issue $ which python3
/usr/local/bin/python3
issue $ python3 --version
Python 3.9.7

I check for clap:

issue $ pip3 show clap
Name: Clap
Version: 0.7
Summary: Command Line Applications for Python
Home-page: UNKNOWN
Author: Matthew "LeafStorm" Frazier
Author-email: leafstormrush@gmail.com
License: MIT/X11
Location: /usr/local/lib/python3.9/site-packages
Requires: 
Required-by:

I check for unidecode:

issue $ pip3 show unidecode
Name: Unidecode
Version: 1.3.2
Summary: ASCII transliterations of Unicode text
Home-page: UNKNOWN
Author: Tomaz Solc
Author-email: tomaz.solc@tablix.org
License: GPL
Location: /usr/local/lib/python3.9/site-packages
Requires: 
Required-by:

I check for colored:

issue $ pip3 show colored
Name: colored
Version: 1.4.2
Summary: Simple library for color and formatting to terminal
Home-page: https://gitlab.com/dslackw/colored
Author: dslackw
Author-email: d.zlatanidis@gamil.com
License: UNKNOWN
Location: /usr/local/lib/python3.9/site-packages
Requires: 
Required-by: 

I run the Makefile, which throws a sed error, which I will fix (see next step):

issue $ make -f Makefile 
mkdir -p ~/.local/bin
cp ./issue.py ~/.local/bin/issue
chmod +x ~/.local/bin/issue
mkdir -p ~/.local/share/issue
cp ./ui.json ~/.local/share/issue/ui.json
cp ./share/*_message ~/.local/share/issue/
mkdir -p ~/.local/lib/python`python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))'`/site-packages/issue
cp -R ./issue/* ~/.local/lib/python`python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))'`/site-packages/issue/
sed -i 's/\<HEAD\>/828af0705247e5aa4efa187802252edecec58966/' ~/.local/lib/python`python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))'`/site-packages/issue/__init__.py
sed: 1: "/Users/[...]/.local ...": invalid command code j
make: *** [install] Error 1

I edit the sed command in the Makefile thusly, based on a search result that said it was a MacOS / sed thing:

OLD: sed -i 's/\<HEAD\>/$(shell git rev-parse HEAD)/' $(LIB_DIR)/issue/__init__.py
NEW: sed -i '' -e s/\<HEAD\>/$(shell git rev-parse HEAD)/' $(LIB_DIR)/issue/__init__.py

I re-run the Makefile, and it seems to be good:

issue $ make -f Makefile 
mkdir -p ~/.local/bin
cp ./issue.py ~/.local/bin/issue
chmod +x ~/.local/bin/issue
mkdir -p ~/.local/share/issue
cp ./ui.json ~/.local/share/issue/ui.json
cp ./share/*_message ~/.local/share/issue/
mkdir -p ~/.local/lib/python`python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))'`/site-packages/issue
cp -R ./issue/* ~/.local/lib/python`python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))'`/site-packages/issue/
sed -i '' -e 's/\<HEAD\>/828af0705247e5aa4efa187802252edecec58966/' ~/.local/lib/python`python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))'`/site-packages/issue/__init__.py

I feel like I should be done (other than some path variable update or something), but I get:

issue $ python3 issue.py 
Traceback (most recent call last):
  File "/usr/local/bin/issue/issue.py", line 18, in <module>
    import clap
  File "/usr/local/lib/python3.9/site-packages/clap/__init__.py", line 14, in <module>
    from clap.base import SingleBase, MultiBase, ScriptError
  File "/usr/local/lib/python3.9/site-packages/clap/base.py", line 76
    except ScriptError, exc:
                      ^
SyntaxError: invalid syntax

What should I be doing?

@jeffofx jeffofx changed the title How to install issues? How to install issue? Sep 20, 2021
@marekjm
Copy link
Owner

marekjm commented Nov 14, 2021

Hi @jeffofx! I'm glad you tried checking issue out. Everything you did was OK, except... that clap you have installed is not the clap you want ;-)

Install this one https://github.com/marekjm/clap From source, of course. make local-install should install in your ~/.local. Remove the clap you have installed and you should be good to go.

@marekjm
Copy link
Owner

marekjm commented Nov 14, 2021

And if not - ping me again.

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

No branches or pull requests

2 participants