Skip to content

Commit 78be090

Browse files
Merge cf41c9f into master
2 parents 00c8b82 + cf41c9f commit 78be090

File tree

2 files changed

+39
-13
lines changed

2 files changed

+39
-13
lines changed

README.md

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,21 @@ from the program.
231231

232232
``` bash
233233
$ cd /abc/myProject
234-
$ vien call -m /abc/myProject/pkg/module.py
234+
$ vien call -m /abc/myProject/pkg/sub/module.py
235235

236-
# runs [python -m pkg.module]
236+
# runs [python -m pkg.sub.module]
237+
# project dir: /abc/myProject
238+
# working dir: /abc/myProject
237239
```
238240

239241
- `module.py` must be located somewhere inside the `/abc/myProject`
240-
- parent subdirectories such as `pkg` must be importable, i.e. must contain
241-
`pkg/__init__.py`
242+
- parent subdirectories such as `pkg` an `sub` must be importable, i.e. must contain
243+
`__init__.py`
244+
- the project directory will be inserted into `$PYTHONPATH` making the module
245+
visible
246+
247+
The project directory can be specified not only by the working directory,
248+
but also by the `-p` parameter.
242249

243250

244251
The `call` command only accepts `.py` files, no module names.
@@ -264,18 +271,37 @@ The optional `-p` parameter can be specified before the `call` word. It allows
264271
you to set the project directory **relative** to the parent directory of the
265272
**file** being run.
266273

267-
``` bash
268-
$ cd any/where # working dir is irrelevant
274+
``` bash
275+
$ cd /far/away
276+
$ vien -p /abc/myProject call -m /abc/myProject/pkg/sub/module.py
277+
278+
# runs [python -m pkg.sub.module]
279+
# project dir: /abc/myProject
280+
# working dir: /far/away
281+
```
282+
283+
``` bash
284+
$ cd /far/away
285+
$ vien -p ../.. call -m /abc/myProject/pkg/sub/module.py
269286

270-
# both of the following calls will use
271-
# /abc/myProject as the project directory
287+
# runs [python -m pkg.sub.module]
288+
# project dir: /abc/myProject (/abc/myProject/pkg/sub/../..)
289+
# working dir: /far/away
290+
```
291+
292+
``` bash
293+
$ cd /abc/myProject/pkg
294+
$ vien -p ../.. call -m sub/module.py
272295

273-
$ vien -p /abc/myProject call /abc/myProject/pkg/main.py
274-
$ vien -p .. call /abc/myProject/pkg/main.py
296+
# runs [python -m pkg.sub.module]
297+
# project dir: /abc/myProject (/abc/myProject/pkg/sub/../..)
298+
# working dir: /abc/myProject/pkg
275299
```
276300

277-
In the second case `..` means that the project directory is
278-
`/abc/myProject/pkg/..`, which resolves to `/abc/myProject`.
301+
302+
303+
304+
279305

280306
# "delete" command
281307

vien/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = "8.0.0"
1+
__version__ = "8.0.1"
22
__copyright__ = "(c) 2020-2021 Artëm IG <github.com/rtmigo>"
33
__license__ = "BSD-3-Clause"

0 commit comments

Comments
 (0)