Skip to content

bootstrap basename can be specified via environment variable #13

Description

@gf-atebbe

This is an odd use case, but if you're trying to import mandrel on a virtual machine with your current working directory being a mapped volume from OSX, it fails because OSX is a case-insensitive filesystem. When python is attempting to load the bootstrap module, it finds Mandrel.py in my current working directory (/mnt/hgfs/atebbe1/Documents/code/thingy/) and seems to load that instead of the installed package.

In this case, I am running mandrel-runner from a directory that contains a Mandrel.py bootstrap file

Traceback (most recent call last):
  File "/home/adam/virtualenv/bin/mandrel-runner", line 9, in <module>
    load_entry_point('mandrel==0.2.0', 'console_scripts', 'mandrel-runner')()
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 558, in load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2682, in load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2355, in load
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2361, in resolve
  File "/mnt/hgfs/atebbe1/Documents/code/thingy/mandrel.py", line 1, in <module>
    bootstrap.SEARCH_PATHS.append("/etc/conf")
NameError: name 'bootstrap' is not defined

To get around this, I would propose not naming the bootstrap file Mandrel.py, and adding support for an environment variable to override mandrel.bootstrap.__BOOTSTRAP_BASENAME

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions