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

Problem with setup.py in 0.1.4 stable release: NameError: name 'version' is not defined at line 32 #60

Open
davidjstudholme opened this issue Nov 5, 2023 · 0 comments

Comments

@davidjstudholme
Copy link

I am using the tarball for the stable release v0.1.4 from here: https://github.com/widdowquinn/find_differential_primers/archive/refs/tags/v0.1.4.tar.gz.

After doing conda install --file requirements-thirdparty.txt and conda install --file requirements.txt, I attempt to run the setup.py script:

python3 setup.py install --prefix ~

This yields the following error message:

Traceback (most recent call last):
  File "/data/djs217/stable_release/find_differential_primers-0.1.4/setup.py", line 32, in <module>
    version = version,
NameError: name 'version' is not defined

Maybe the script needs to be executed with python2 rather than python3? So, I checked this:

python --version
Python 2.7.18 :: Anaconda, Inc.

Executing the script using this python gives a similar error message:

python setup.py install --prefix ~

Traceback (most recent call last):
  File "setup.py", line 32, in <module>
    version = version,
NameError: name 'version' is not defined

Does this suggest a bug at line 32 in setup.py? Or an I doing something daft?

Just to be absolutely clear, this is first few lines of the code that I see in setup.py:

# try using distribute or setuptools or distutils.
try:
    import distribute_setup
    distribute_setup.use_setuptools()
except:
    pass

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup


import sys
import re

# parse version from package/module without importing or evaluating the code
with open('find_differential_primers/find_differential_primers.py') as fh:
    for line in fh:
        m = re.search(r"^__version__ = '(?P<version>[^']+)'$", line)
        if m:
            version = m.group('version')
            break

if sys.version_info <= (2, 6):
    sys.stderr.write("ERROR: pyADHoRe requires Python Version 2.7 or " +
                     "above...exiting.\n")
    sys.exit(1)

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

1 participant