jonghyunharrylee/pyPCGA

Wrong packaging as setup.py imports pyPCGA

Closed this issue · 0 comments

The packaging seems wrong as setup.py import pyPCGA and consequently its dependencies before they are even installed:

$ pip install git+https://****@github.com/jonghyunharrylee/pyPCGA.git
Collecting git+https://****@github.com/jonghyunharrylee/pyPCGA.git
  Cloning https://****@github.com/jonghyunharrylee/pyPCGA.git to /tmp/pip-req-build-ko5042bo
  Running command git clone --filter=blob:none -q 'https://****@github.com/jonghyunharrylee/pyPCGA.git' /tmp/pip-req-build-ko5042bo
  Resolved https://****@github.com/jonghyunharrylee/pyPCGA.git to commit 8294452a1c67b6cdc0c36d492c7bb2a769f76fb3
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /tmp/test/venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-ko5042bo/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-ko5042bo/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-x9bt3f13
       cwd: /tmp/pip-req-build-ko5042bo/
  Complete output (9 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-req-build-ko5042bo/setup.py", line 8, in <module>
      from pyPCGA import __name__, __author__
    File "/tmp/pip-req-build-ko5042bo/pyPCGA/__init__.py", line 8, in <module>
      from .pcga import PCGA
    File "/tmp/pip-req-build-ko5042bo/pyPCGA/pcga.py", line 3, in <module>
      import numpy as np
  ModuleNotFoundError: No module named 'numpy'
  ----------------------------------------
WARNING: Discarding git+https://****@github.com/jonghyunharrylee/pyPCGA.git. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Workaround: define the author and the version in the setup.py and retrieve it in __init__.py