Skip to content

Commit

Permalink
Separate packages required for testing/linting (elastic#1672)
Browse files Browse the repository at this point in the history
* note associated licenses with deps

* split dev deps into their own file

* include requirements-dev for dev env setup

* fix typo

* update minimum python version

* include requirements-dev check

* simplify dep install guidance

* update dev tools
  • Loading branch information
ebeahan authored Nov 22, 2021
1 parent 7a7cda5 commit 4df5239
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 25 deletions.
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ There are two primary ways in which you can contribute to ECS.
You need these tools to contribute to the ECS repo:

* [Git](https://git-scm.com/)
* [Python 3.6+](https://www.python.org/)
* [Go 1.13](https://golang.org/)
* [Python 3.8+](https://www.python.org/)

### Submitting Changes

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ test: ve
# Create a virtualenv to run Python.
.PHONY: ve
ve: build/ve/bin/activate
build/ve/bin/activate: scripts/requirements.txt
build/ve/bin/activate: scripts/requirements.txt scripts/requirements-dev.txt
@test -d build/ve || python3 -mvenv build/ve
@build/ve/bin/pip install -Ur scripts/requirements.txt
@build/ve/bin/pip install -Ur scripts/requirements.txt -r scripts/requirements-dev.txt
@touch build/ve/bin/activate

# Check YAML syntax (currently not enforced).
Expand Down
22 changes: 4 additions & 18 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ relevant artifacts for their unique set of data sources.
- [Setup and Install](#setup-and-install)
* [Prerequisites](#prerequisites)
+ [Clone from GitHub](#clone-from-github)
+ [Option 1: Install dependencies via make (recommended)](#option-1-install-dependencies-via-make-recommended)
+ [Option 2: Install dependencies via pip](#option-2-install-dependencies-via-pip)
+ [Install dependencies](#install-dependencies)
- [Usage](#usage)
* [Getting Started - Generating Artifacts](#getting-started---generating-artifacts)
* [Generator Options](#generator-options)
Expand Down Expand Up @@ -77,7 +76,7 @@ See [usage-example/](usage-example/) for a complete example with source files.

### Prerequisites

* [Python 3.6+](https://www.python.org/)
* [Python 3.8+](https://www.python.org/)
* [make](https://www.gnu.org/software/make/)
* [pip](https://pypi.org/project/pip/)
* [git](https://git-scm.com/)
Expand All @@ -99,22 +98,9 @@ Prior to installing dependencies or running the tools, it's recommended to check
$ git checkout v1.5.0
```

#### Option 1: Install dependencies via make (recommended)
#### Install dependencies

Setting up a `virtualenv` (`venv`) can be accomplished by running `make ve` the top-level of the ECS repo:

```
$ make ve
```

All necessary Python dependencies will also be installed with `pip`.

You can use the Python and dependencies from this isolated virtual environment
by using `build/ve/bin/python` instead of `python` in the examples shown here.

#### Option 2: Install dependencies via pip

Install dependencies using `pip` (An active `virutalenv` is recommended):
Install dependencies using `pip` (An active `virtualenv` is recommended):

```
$ pip install -r scripts/requirements.txt
Expand Down
6 changes: 6 additions & 0 deletions scripts/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# License: MIT
autopep8==1.4.4
# License: BSD
mock==4.0.2
# License: GPLv3
yamllint==1.19.0
6 changes: 3 additions & 3 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pip
# License: MIT
PyYAML==5.4
autopep8==1.4.4
yamllint==1.19.0
mock==4.0.2
# License: BSD
gitpython==3.1.2
# License: BSD
Jinja2==2.11.3

0 comments on commit 4df5239

Please sign in to comment.