Skip to content

Commit 17878c8

Browse files
Merge pull request #10 from ConorSheehan1/poetry
Poetry closes #7 #8
2 parents 83ddb46 + a3eaaed commit 17878c8

File tree

18 files changed

+1259
-990
lines changed

18 files changed

+1259
-990
lines changed

.bumpversion.cfg

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[bumpversion]
2+
current_version = 0.1.2
3+
4+
[bumpversion:file:pyproject.toml]
5+
search = version = "{current_version}"
6+
replace = version = "{new_version}"
7+
8+
[bumpversion:file:osxdocker/__init__.py]
9+
search = __version__ = "{current_version}"
10+
replace = __version__ = "{new_version}"

.githooks/install.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Standard Library
2+
import os
3+
from glob import glob
4+
5+
# Third party
6+
import fire
7+
8+
githooks_dir = os.path.dirname(os.path.realpath(__file__))
9+
10+
11+
def install_hooks(force=False):
12+
"""
13+
symlink every file from .githooks to .git/hooks and make them executable
14+
15+
Args:
16+
force (bool): force the symlink to overwrite existing files in .git/hooks
17+
"""
18+
ln_args = "--symbolic"
19+
if force:
20+
ln_args += " --force"
21+
22+
for filepath in glob(f"{githooks_dir}/*"):
23+
if filepath.endswith("install.py"):
24+
continue
25+
26+
filename = os.path.basename(filepath)
27+
new_path = os.path.join(githooks_dir, "..", ".git", "hooks", filename)
28+
os.system(f"ln {ln_args} {filepath} {new_path}")
29+
os.system(f"sudo chmod +x {new_path}")
30+
31+
32+
if __name__ == "__main__":
33+
fire.Fire(install_hooks)

.githooks/pre-commit

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
ret=0
4+
message=""
5+
6+
# if ci_lint doesn't return 0
7+
if ! poetry run task ci_lint; then
8+
((ret+=1))
9+
message="$message to fix run: poetry run task lint"
10+
fi
11+
12+
# if diff outputs anything
13+
difflen=$(poetry run task isort --diff | wc -l)
14+
if [ "$difflen" -gt 1 ]; then
15+
((ret+=1))
16+
message="$message to fix run: poetry run task isort"
17+
fi
18+
19+
echo "$message"
20+
exit $ret

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,16 @@ jobs:
2525
uses: actions/setup-python@v1
2626
with:
2727
python-version: ${{ matrix.python }}
28-
- name: Install Pipenv
28+
- name: Install Poetry
2929
run: |
3030
python -m pip install --upgrade pip
31-
pip install pipenv
32-
# must be in it's own step, see https://github.com/actions/runner/issues/258
31+
pip install poetry
3332
- name: Install python packages
3433
run: |
35-
pipenv install --verbose --dev --skip-lock --python=${{ matrix.python }}
34+
poetry install
3635
# - name: Run tests
3736
# run: |
3837
# pipenv run tests
3938
- name: Lint with black
4039
run: |
41-
pipenv run black --check .
40+
poetry run task ci_lint

.github/workflows/deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616
uses: actions/setup-python@v1
1717
with:
1818
python-version: 3
19-
- name: Install flit
19+
- name: Install poetry
2020
run: |
2121
python -m pip install --upgrade pip
22-
pip install flit
22+
pip install poetry
2323
- name: Publish to pypi
2424
env:
25-
FLIT_USERNAME: __token__
26-
FLIT_PASSWORD: ${{ secrets.osxdocker_pypi_api_token }}
25+
POETRY_HTTP_BASIC_PYPI_USERNAME: __token__
26+
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.osxdocker_pypi_api_token }}
2727
run: |
28-
flit publish
28+
poetry publish --build

.readthedocs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
3+
python:
4+
version: 3.6
5+
install:
6+
- method: pip
7+
path: .
8+
extra_requirements:
9+
- docs
10+
11+
sphinx:
12+
configuration: docs/source/conf.py

Pipfile

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)