Skip to content

Commit

Permalink
Switch to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
dmerejkowsky committed Jan 30, 2020
1 parent 24217ad commit f885858
Show file tree
Hide file tree
Showing 9 changed files with 847 additions and 104 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@ jobs:
with:
python-version: 3.7

- name: Install dmenv
uses: TankerHQ/[email protected]
with:
dmenv-version: 0.20.0

- name: Prepare project for development
run: dmenv install
run: |
python -m pip install poetry
python -m poetry config virtualenvs.create false
python -m poetry install
- name: Run linters
run: |
source $(dmenv show:bin_path)/activate
python lint.py
python -m poetry run python lint.py
13 changes: 6 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,20 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install dmenv
uses: TankerHQ/[email protected]
with:
dmenv-version: 0.20.0

- name: Prepare project for development
run: dmenv install
run: |
python -m pip install poetry
python -m poetry config virtualenvs.create false
python -m poetry install
- name: Run tests
run: |
# tests run git commands, and they need
# a proper git identity for that
git config --global user.email "[email protected]"
git config --global user.name "Tasty Test"
dmenv run -- pytest --cov . --cov-report xml
python -m poetry run pytest --cov . --cov-report xml
- name: Send coverage to codecov.io
uses: codecov/codecov-action@v1
Expand Down
2 changes: 1 addition & 1 deletion lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self, name, cmd, env=None):

def run(self):
ui.info_2(self.name)
rc = subprocess.call(self.cmd, env=self.env)
rc = subprocess.call(["poetry", "run"] + list(self.cmd), env=self.env)
self.ok = rc == 0


Expand Down
Loading

0 comments on commit f885858

Please sign in to comment.