1

I've written a python module which when imported, assumes the importing file has a predefined folder name at some level up in the folder hierarchy. My module then proceeds to add the predefined folder to sys.path.

I want to upload this package to PyPI, but I want to somehow enable the user to input the pre-defined folder name on install.

I've looked at: How to obtain arguments passed to setup.py from pip with '--install-option'? which seems closest to what I"m trying to achieve, but the proposed solution doesn't enable a default (user defined) configuration to the packaged module itself.

Any ideas?

ec2604
  • 501
  • 3
  • 11
  • 1
    I'd suggest that this is the kind of thing that should be in a config file that is read when the module loads, rather than an install-time parameter. – match Feb 24 '18 at 10:00
  • 1
    @match In retrospect you're right, I wanted to minimize user configuration, but this rules out the option of using this module for several folders. I guess I"ll switch to an environment variable instead. Thanks! – ec2604 Feb 24 '18 at 10:30

0 Answers0