On Wed, 8 Nov 2017 at 15:58 Heli <heml...@gmail.com> wrote:

> Is there anyway I can run my external script without changing the absolute
> path from (1) to (2) in my code.

I would recommend using tox [0] to run your test script, and setting up an
entry point in your `setup.py` [1] so that your `main` command is
"installed" when you install the package.
This also means that regular users of your package will be able to run the
script by just typing the command name you choose, instead of needing to
know exactly where the package got installed.

> I use subprocess.call to run main.py within my external script and it gets
> few arguments to run.

tox handles setting up a virtualenv & installing your packages into it,
which means in the context of your tox run, when your test script calls out
to your `main` "entry point" using `subprocess.call` it will be available
in the local $PATH

[0] https://tox.readthedocs.io/en/latest/

Matt Wheeler

Reply via email to