Skip to content

Commit

Permalink
Merge b0d2a1a into master
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored May 23, 2021
2 parents b815fba + b0d2a1a commit 28d5803
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 69 deletions.
7 changes: 0 additions & 7 deletions .github/package_version.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

- name: Run pkg tests
run: |
./test_pkg.sh
python ./test_pkg.py
to-staging:
needs: test
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:

# ADD GITHUB RELEASE
- name: Get the Python package version
run: echo "PKGVER=$(.github/package_version.sh)" >> $GITHUB_ENV
run: echo "PKGVER=$(python setup.py --version)" >> $GITHUB_ENV
- name: Publish GitHub release
uses: softprops/action-gh-release@v1
with:
Expand Down
36 changes: 16 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ $ vien call main.py

## create

`vien shell` creates a virtual environment corresponding to the working
directory.
`vien create` сreates a virtual environment that will correspond the current
working directory. The **working directory** in this case is assumed to be
your **project directory**. Subsequent calls to other `vien` commands in the
same directory will use the same virtual environment.

``` bash
$ cd /path/to/myProject
Expand All @@ -127,22 +129,16 @@ $ vien create
By default `vien` will try to use `python3` as the interpreter for the virtual
environment.

If you have more than one Python version, provide one more argument, point to
the proper interpreter the way you execute it.

E.g. if you execute scripts like that

``` bash
$ python3.8 /path/to/script.py
```

Create virtual environment like that:
If you have more than one Python version, you can provide an argument to point
to the proper interpreter. For example,

``` bash
$ vien create python3.8
```

Or provide full path to the interpreter:
Here `python3.8` is literally the name of the command you are running python
with (file available from `$PATH` or a symlink). Since not all shell commands
can be easily resolved, sometimes you have to specify the full path.

``` bash
$ vien create /usr/local/opt/python@3.8/bin/python3
Expand All @@ -152,7 +148,7 @@ $ vien create /usr/local/opt/python@3.8/bin/python3

`vien shell` starts interactive bash session in the virtual environment.

```bash
``` bash
$ cd /path/to/myProject
$ vien shell

Expand All @@ -161,7 +157,7 @@ $ vien shell

Now you are inside the virtual environment.

```bash
``` bash
(myProject)$ which python3 # now we are using separate copy of Python
(myProject)$ echo $PATH # everything is slightly different

Expand All @@ -171,7 +167,7 @@ Now you are inside the virtual environment.

Get out of the virtual environment:

```bash
``` bash
(myProject)$ exit

$ _
Expand All @@ -183,7 +179,7 @@ Now you're back.

`vien run COMMAND` runs any shell command in the virtual environment.

```bash
``` bash
$ cd /path/to/myProject
$ vien run python3 use_requests.py arg1 arg2 # runs in virtual environment
$ vien run pip3 install requests # installs packages into virtual environment
Expand All @@ -192,7 +188,7 @@ $ vien run pip3 install requests # installs packages into virtual e
<details>
<summary>is an equivalent to</summary><br/>

```bash
``` bash
$ cd /path/to/myProject

$ source /path/to/the/venv/bin/activate
Expand All @@ -210,15 +206,15 @@ $ /path/to/the/venv/bin/deactivate

`vien call PYFILE` executes a `.py` script in the virtual environment.

```bash
``` bash
$ cd /path/to/myProject
$ vien call main.py
```

The optional `-p` parameter allows you to specify the project directory relative
to the parent directory of the file being run.

```bash
``` bash
$ cd any/where
$ vien call -p /path/to/myProject main.py
$ vien call -p . main.py
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
neatest
mypy
mypy
chkpkg
10 changes: 10 additions & 0 deletions test_pkg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python3

from chkpkg import Package

if __name__ == "__main__":
with Package() as pkg:
pkg.run_shell_code('vien --help')

print("\nPackage is OK!")

38 changes: 0 additions & 38 deletions test_pkg.sh

This file was deleted.

2 changes: 1 addition & 1 deletion vien/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "4.3.0"
__version__ = "4.3.1"
__copyright__ = "(c) 2020-2021 Artëm IG <github.com/rtmigo>"
__license__ = "BSD-3-Clause"

0 comments on commit 28d5803

Please sign in to comment.