Skip to content

Commit 382fa61

Browse files
authored
Switch from Pipenv to Poetry (#616)
* Switch from Pipenv to Poetry * Use cache key * Oops * Honestly what the heck * y tho * Fix CircleCI configs * Move settings to PyProject.toml * Makefile changes * Also Python is needed apparently * Update readme * Why are you being so difficult? * Don't use editable install for Coverage
1 parent f1093a7 commit 382fa61

File tree

11 files changed

+151
-1036
lines changed

11 files changed

+151
-1036
lines changed

.circleci/config.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ commands:
1515
- run: sudo chown -R circleci:circleci /usr/local/bin
1616
- run: sudo chown -R circleci:circleci /usr/local/lib/python<< parameters.python_version >>/site-packages
1717
- restore_cache:
18-
key: << parameters.cache_key_prefix >>1-{{ checksum "tox.ini" }}-{{ checksum "Pipfile.lock" }}
18+
key: << parameters.cache_key_prefix >>1-{{ checksum "tox.ini" }}-{{ checksum "pyproject.toml" }}
1919
- run:
20-
name: Install tox
20+
name: Install Poetry and Tox
2121
shell: /bin/bash -leo pipefail
2222
command: |
2323
pip install -U pip
2424
pip install tox
25+
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
2526
2627
teardown_tests:
2728
description: "Store the cache for the current run."
@@ -34,7 +35,7 @@ commands:
3435
type: string
3536
steps:
3637
- save_cache:
37-
key: << parameters.cache_key_prefix >>1-{{ checksum "tox.ini" }}-{{ checksum "Pipfile.lock" }}
38+
key: << parameters.cache_key_prefix >>1-{{ checksum "tox.ini" }}-{{ checksum "pyproject.toml" }}
3839
paths:
3940
- "/home/circleci/project/.tox"
4041
- "/usr/local/bin"
@@ -84,23 +85,25 @@ commands:
8485
steps:
8586
- checkout
8687
- restore_cache:
87-
key: pypy-deps2-{{ checksum "tox.ini" }}-{{ checksum "Pipfile.lock" }}
88+
key: pypy-deps2-{{ checksum "tox.ini" }}-{{ checksum "pyproject.toml" }}
8889
- run:
89-
name: Install tox
90+
name: Install Poetry and Tox
9091
command: |
92+
apt-get update && apt-get install -y python3 curl
9193
pip install -U pip
9294
pip install tox
95+
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
9396
- run:
9497
name: Run Tests
9598
command: |
96-
CCI_NODE_TESTS=$(circleci tests glob "tests/**/*_test.*py" "tests/**/test_*.*py" | circleci tests split)
99+
CCI_NODE_TESTS=$(circleci tests glob "tests/**/*_test.*py" "tests/**/test_*.*py" | circleci tests split --split-by=timings)
97100
printf "Test files:\n"
98101
echo "$CCI_NODE_TESTS"
99102
printf "\n"
100103
tox -e pypy3 -- $CCI_NODE_TESTS
101104
no_output_timeout: 30m
102105
- save_cache:
103-
key: pypy-deps2-{{ checksum "tox.ini" }}-{{ checksum "Pipfile.lock" }}
106+
key: pypy-deps2-{{ checksum "tox.ini" }}-{{ checksum "pyproject.toml" }}
104107
paths:
105108
- "/root/project/.tox"
106109
- "/usr/local/bin"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,5 @@ TODO
6767
lintout.txt
6868
lispcore.py
6969
.idea/
70-
.envrc
70+
.envrc
71+
poetry.lock

MANIFEST.in

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

Makefile

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,47 @@
1-
.PHONY: setup-dev
2-
setup-dev:
3-
@pipenv install --dev
4-
@pipenv install -e .
5-
6-
71
.PHONY: release
82
release:
93
@rm -rf ./build
104
@rm -rf ./dist
11-
@pipenv run python setup.py sdist bdist_wheel --universal
12-
@pipenv run twine upload dist/*
5+
@poetry publish --build
136

147

158
.PHONY: docs
169
docs:
17-
@pipenv run sphinx-build -M html "./docs" "./docs/_build"
10+
@poetry run sphinx-build -M html "./docs" "./docs/_build"
1811

1912

2013
.PHONY: format
2114
format:
22-
@pipenv run sh -c 'isort --profile black . && black .'
15+
@poetry run sh -c 'isort --profile black . && black .'
16+
17+
18+
.PHONY: repl
19+
repl:
20+
@BASILISP_USE_DEV_LOGGER=true poetry run basilisp repl
21+
22+
23+
.PHONY: test
24+
test:
25+
@rm -f .coverage*
26+
@TOX_SKIP_ENV='pypy3|safety|coverage' poetry run tox -p 4
2327

2428

2529
lispcore.py:
2630
@BASILISP_DO_NOT_CACHE_NAMESPACES=true \
27-
pipenv run basilisp run -c \
31+
poetry run basilisp run -c \
2832
'(with [f (python/open "lispcore.py" "w")] (.write f basilisp.core/*generated-python*))'
29-
@pipenv run black lispcore.py
33+
@poetry run black lispcore.py
3034

3135

3236
.PHONY: clean
3337
clean:
3438
@rm -rf ./lispcore.py
3539

3640

37-
.PHONY: repl
38-
repl:
39-
@BASILISP_USE_DEV_LOGGER=true pipenv run basilisp repl
40-
41-
4241
.PHONY: pypy-shell
4342
pypy-shell:
4443
@docker run -it \
4544
--mount src=`pwd`,target=/usr/src/app,type=bind \
4645
--workdir /usr/src/app \
4746
pypy:3.6-7.3-slim-buster \
48-
/bin/sh -c 'pip install -e . && basilisp repl'
49-
50-
51-
.PHONY: test
52-
test:
53-
@rm -f .coverage*
54-
@TOX_SKIP_ENV='pypy3|safety|coverage' pipenv run tox -p 4
47+
/bin/sh -c 'pip install -e . && basilisp repl'

Pipfile

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

0 commit comments

Comments
 (0)