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

Apt doesn't work from site-packages (a.k.a. setup.py incomplete) #1

Open
maphew opened this issue Oct 28, 2014 · 1 comment
Open

Apt doesn't work from site-packages (a.k.a. setup.py incomplete) #1

maphew opened this issue Oct 28, 2014 · 1 comment

Comments

@maphew
Copy link
Owner

maphew commented Oct 28, 2014

D:\>pip install --editable b:\code\apt
Obtaining file:///b:/code/apt
  Running setup.py (path:b:/code/apt\setup.py) egg_info for package from file://
/b:/code/apt

Installing collected packages: apt
  Running setup.py develop for apt
    B:\o4w\apps\Python27\lib\site-packages\setuptools-1.3.2-py2.7.egg\setuptools
\command\easy_install.py:320: UserWarning: Unbuilt egg for apt-Osgeo4w-package-m
anager [unknown version] (b:\code\apt)

    Creating b:\o4w\apps\python27\lib\site-packages\apt.egg-link (link to .)
    Adding apt 0.3 to easy-install.pth file
    Installing apt-script.py script to B:\o4w\apps\Python27\Scripts
    Installing apt.exe script to B:\o4w\apps\Python27\Scripts
    Installing apt.exe.manifest script to B:\o4w\apps\Python27\Scripts

    Installed b:\code\apt
Successfully installed apt
Cleaning up...

D:\>apt
Traceback (most recent call last):
  File "B:\o4w\apps\Python27\Scripts\apt-script.py", line 9, in <module>
    load_entry_point('apt==0.3', 'console_scripts', 'apt')()
  File "b:\code\apt\apt.py", line 1271, in main
    last_mirror = get_config('last-mirror')
  File "b:\code\apt\apt.py", line 727, in get_config
    f = os.path.join(config, fname)
NameError: global name 'config' is not defined
@maphew
Copy link
Owner Author

maphew commented Oct 28, 2014

root cause is that we don't use the if __name__ == '__main__': to call a single function, so we can't have pip create an .exe in site-packages to point to it, e.g. apt:main where main is the name of the runner inside apt.py.

I tried the easy way out of just moving everything under if __name__ == '__main__': into def main() but that fails because the expected globals aren't set. So this can't be fixed until we finish moving everything into proper encapsulated functions.

(though it might be possible to get pip to create an .exe to call Scripts\apt.py?)

@maphew maphew changed the title Apt doesn't work from site-packages Apt doesn't work from site-packages (a.k.a. setup.py incomplete) Nov 5, 2014
maphew added a commit that referenced this issue Jan 8, 2015
Started updating following the Python Packaging Guide, and thought maybe
`apt:__main__` would work. Nope, it doesn't. Also added
`zip_safe=False` as that was necessary in Arcplus.
maphew pushed a commit that referenced this issue Apr 9, 2015
Updated error handling for do_download function
maphew added a commit that referenced this issue Dec 27, 2022
pypa/setuptools vulnerable to Regular Expression Denial of Service (ReDoS) #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