Skip to content

Commit d59164f

Browse files
authored
meta: Rename virtualenv, add check target (#183)
* meta: Rename virtualenv, add check target * fix: Remove useless arg from chown * fix: Ignore new venv path in flake8
1 parent 2ce922d commit d59164f

File tree

4 files changed

+32
-29
lines changed

4 files changed

+32
-29
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ ignore = E203, E266, E501, W503, E402, E731
33
max-line-length = 80
44
max-complexity = 18
55
select = B,C,E,F,W,T4,B9
6-
exclude=venv,.eggs
6+
exclude=.venv,.eggs

Makefile

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ doc:
2626
@cargo doc
2727
.PHONY: doc
2828

29-
test: cargotest pytest integration-test
29+
test: cargotest pytest
3030
.PHONY: test
3131

3232
cargotest: GeoLite2-City.mmdb
@@ -54,29 +54,29 @@ pytest:
5454
@$(MAKE) -C py test
5555
.PHONY: pytest
5656

57-
venv/bin/python: Makefile
58-
rm -rf venv
59-
virtualenv -p $$SEMAPHORE_PYTHON_VERSION venv
57+
.venv/bin/python: Makefile
58+
rm -rf .venv
59+
virtualenv -p $$SEMAPHORE_PYTHON_VERSION .venv
6060

61-
integration-test: venv/bin/python
62-
venv/bin/pip install -U pytest pytest-localserver requests flask "sentry-sdk>=0.2.0" pytest-rerunfailures pytest-xdist "git+https://github.com/untitaker/pytest-sentry#egg=pytest-sentry"
61+
integration-test: .venv/bin/python
62+
.venv/bin/pip install -U pytest pytest-localserver requests flask "sentry-sdk>=0.2.0" pytest-rerunfailures pytest-xdist "git+https://github.com/untitaker/pytest-sentry#egg=pytest-sentry"
6363
cargo build
64-
@venv/bin/pytest tests -n12 --reruns 5
64+
@.venv/bin/pytest tests -n12 --reruns 5
6565
.PHONY: integration-test
6666

67-
python-format: venv/bin/python
68-
venv/bin/pip install -U black
69-
venv/bin/black .
67+
python-format: .venv/bin/python
68+
.venv/bin/pip install -U black
69+
.venv/bin/black .
7070
.PHONY: python-format
7171

72-
python-format-check: venv/bin/python
73-
venv/bin/pip install -U black
74-
venv/bin/black --check .
72+
python-format-check: .venv/bin/python
73+
.venv/bin/pip install -U black
74+
.venv/bin/black --check .
7575
.PHONY: python-format
7676

77-
python-lint: venv/bin/python
78-
venv/bin/pip install -U flake8
79-
venv/bin/flake8
77+
python-lint: .venv/bin/python
78+
.venv/bin/pip install -U flake8
79+
.venv/bin/flake8
8080
.PHONY: python-format
8181

8282
format: python-format
@@ -97,6 +97,9 @@ clippy:
9797
lint: clippy python-lint
9898
.PHONY: lint
9999

100+
check: format test
101+
.PHONY: check
102+
100103
test-process-event:
101104
# Process a basic event and assert its output
102105
bash -c 'diff \

py/Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
venv:
2-
@$(MAKE) -C .. venv/bin/python
3-
.PHONY: venv
1+
.venv:
2+
@$(MAKE) -C .. .venv/bin/python
3+
.PHONY: .venv
44

5-
install: venv
6-
SEMAPHORE_DEBUG=1 ../venv/bin/pip install -v --editable .
5+
install: .venv
6+
SEMAPHORE_DEBUG=1 ../.venv/bin/pip install -v --editable .
77
.PHONY: install
88

99
test: install
10-
../venv/bin/pip install -U pytest
11-
@../venv/bin/pytest tests
10+
../.venv/bin/pip install -U pytest
11+
@../.venv/bin/pytest tests
1212
.PHONY: test
1313

1414
manylinux:
1515
@$(MAKE) -C .. manylinux
1616
.PHONY: manylinux
1717

18-
wheel: venv
19-
@../venv/bin/python setup.py bdist_wheel
18+
wheel: .venv
19+
@../.venv/bin/python setup.py bdist_wheel
2020
.PHONY: wheel
2121

22-
sdist: venv
23-
@../venv/bin/python setup.py sdist --format=zip
22+
sdist: .venv
23+
@../.venv/bin/python setup.py sdist --format=zip
2424
.PHONY: sdist
2525

2626
clean:

scripts/docker-manylinux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ docker run \
1313
# Fix permissions for shared directories
1414
USER_ID=$(id -u)
1515
GROUP_ID=$(id -g)
16-
sudo chown -R ${USER_ID}:${GROUP_ID} cabi/target/ py/venv/ ${HOME}/.cargo
16+
sudo chown -R ${USER_ID}:${GROUP_ID} cabi/target/ ${HOME}/.cargo

0 commit comments

Comments
 (0)