Skip to content

Commit

Permalink
examples: separate code files in code.dvc.org/tutorial-nlp, and
Browse files Browse the repository at this point in the history
1. for tutorial preparation
2. for get-started example-pipeline
(soon both will be merged, see #564

AND standardize venv+pip install instructions throughout docs
  • Loading branch information
jorgeorpinel committed Aug 16, 2019
1 parent 30f3db2 commit d3ac9dd
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 42 deletions.
4 changes: 2 additions & 2 deletions static/docs/commands-reference/import-url.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ $ rm -f code.zip

### Click and expand to setup the environment

For this step we'll need to install the project requirements. For that we
**strongly** recommend creating a virtual environment with a tool such as
Let's install the requirements. But before we do that, we **strongly** recommend
creating a virtual environment with a tool such as
[virtualenv](https://virtualenv.pypa.io/en/stable/):

```dvc
Expand Down
14 changes: 7 additions & 7 deletions static/docs/get-started/connect-code-and-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ $ tree
 └── train.py
```

We **strongly** recommend using
[virtualenv](https://virtualenv.pypa.io/en/stable/) or a similar tool to isolate
your environment:
Now let's install the requirements. But before we do that, we **strongly**
recommend creating a virtual environment with a tool such as
[virtualenv](https://virtualenv.pypa.io/en/stable/):

```dvc
$ virtualenv .env
$ echo ".env/" >> .gitignore
$ virtualenv -p python3 .env
$ source .env/bin/activate
$ echo ".env/" >> .gitignore
$ pip install -r requirements.txt
```

Now, we are ready to install dependencies to run the code:
Save the progress to Git:

```dvc
$ pip install -U -r requirements.txt
$ git add .
$ git commit -m "add code"
```
Expand Down
17 changes: 6 additions & 11 deletions static/docs/get-started/example-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,22 @@ your browser to download `code.zip`.
```dvc
$ mkdir example && cd example
$ git init
$ wget https://code.dvc.org/tutorial-nlp/code.zip
$ wget https://code.dvc.org/tutorial-nlp/pipeline.zip
$ unzip code.zip
$ rm -f code.zip
$ git add code/
$ git commit -m "download and initialize code"
```

(Optional) It's highly recommended to initialize a virtual environment with
[virtualenv](https://virtualenv.pypa.io/en/stable/) or a similar tool to keep
your global packages clean and untouched:
Now let's install the requirements. But before we do that, we **strongly**
recommend creating a virtual environment with a tool such as
[virtualenv](https://virtualenv.pypa.io/en/stable/):

```dvc
$ virtualenv .env
$ virtualenv -p python3 .env
$ source .env/bin/activate
$ echo ".env/" >> .gitignore
```

Install the required dependencies:

```dvc
$ pip install -r code/requirements.txt
$ pip install -r requirements.txt
```

Next, we will create a pipeline step-by-step, utilizing the same set of commands
Expand Down
13 changes: 4 additions & 9 deletions static/docs/get-started/example-versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,14 @@ $ cd example-versioning
This command pulls a repository with a single script `train.py` that runs the
training.

(Optional) It's highly recommended to initialize a virtual environment with
[virtualenv](https://virtualenv.pypa.io/en/stable/) or a similar tool to keep
your global packages clean and untouched:
Now let's install the requirements. But before we do that, we **strongly**
recommend creating a virtual environment with a tool such as
[virtualenv](https://virtualenv.pypa.io/en/stable/):

```dvc
$ virtualenv .env
$ virtualenv -p python3 .env
$ source .env/bin/activate
$ echo ".env/" >> .gitignore
```

Install required dependencies:

```dvc
$ pip install -r requirements.txt
```

Expand Down
19 changes: 7 additions & 12 deletions static/docs/tutorial/preparation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,21 @@ download `code.zip`.
$ mkdir classify
$ cd classify
$ git init
$ wget https://dvc.org/s3/so/code.zip
$ wget https://code.dvc.org/tutorial-nlp/code.zip
$ unzip code.zip -d code && rm -f code.zip
$ git add code/
$ git commit -m "download code"
```

(Optional) It's highly recommended to initialize a virtual environment with
[virtualenv](https://virtualenv.pypa.io/en/stable/) or a similar tool to keep
your global packages clean and untouched:
Now let's install the requirements. But before we do that, we **strongly**
recommend creating a virtual environment with a tool such as
[virtualenv](https://virtualenv.pypa.io/en/stable/):

```dvc
$ virtualenv .env
$ virtualenv -p python3 .env
$ source .env/bin/activate
$ echo ".env/" >> .git/info/exclude
```

Install the code requirements:

```dvc
$ pip install -r code/requirements.txt
$ echo ".env/" >> .gitignore
$ pip install -r requirements.txt
```

## Install DVC
Expand Down
2 changes: 1 addition & 1 deletion static/docs/user-guide/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ install Python.
Install DVC in editable mode with `pip install -e ".[all,tests]"`. We
**strongly** recommend initializing a
[virtual environment](https://virtualenv.pypa.io/en/latest/userguide/) before
installing the required libraries. For example:
doing so:

```dvc
$ cd dvc
Expand Down

0 comments on commit d3ac9dd

Please sign in to comment.