Skip to content

Commit 15e4fbb

Browse files
committed
Revert "Replace Makefile with poe tasks in pyproject.yaml (danielgtaylor#118)"
This reverts commit c513853
1 parent 8f3065b commit 15e4fbb

File tree

5 files changed

+70
-549
lines changed

5 files changed

+70
-549
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install dependencies
2525
run: poetry install
2626
- name: Run black
27-
run: poetry run poe check-style
27+
run: make check-style
2828

2929
run-tests:
3030
runs-on: ubuntu-latest
@@ -53,8 +53,8 @@ jobs:
5353
poetry install
5454
- name: Run tests
5555
run: |
56-
poetry run poe generate
57-
poetry run poe test
56+
make generate
57+
make test
5858
5959
build-release:
6060
runs-on: ubuntu-latest

Makefile

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.PHONY: help setup generate test types format clean plugin full-test check-style
2+
3+
help: ## - Show this help.
4+
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
5+
6+
# Dev workflow tasks
7+
8+
generate: ## - Generate test cases (do this once before running test)
9+
poetry run python -m tests.generate
10+
11+
test: ## - Run tests
12+
poetry run pytest --cov betterproto
13+
14+
types: ## - Check types with mypy
15+
poetry run mypy src/betterproto --ignore-missing-imports
16+
17+
format: ## - Apply black formatting to source code
18+
poetry run black . --exclude tests/output_
19+
20+
clean: ## - Clean out generated files from the workspace
21+
rm -rf .coverage \
22+
.mypy_cache \
23+
.pytest_cache \
24+
dist \
25+
**/__pycache__ \
26+
tests/output_* \
27+
**/*.egg-info
28+
29+
# Manual testing
30+
31+
# By default write plugin output to a directory called output
32+
o=output
33+
plugin: ## - Execute the protoc plugin, with output write to `output` or the value passed to `-o`
34+
mkdir -p $(o)
35+
poetry run python -m grpc.tools.protoc $(i) --python_betterproto_out=$(o)
36+
37+
# CI tasks
38+
39+
full-test: generate ## - Run full testing sequence with multiple pythons
40+
poetry run tox
41+
42+
check-style: ## - Check if code style is correct
43+
poetry run black . --check --diff --exclude tests/output_

README.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,10 @@ datetime.datetime(2019, 1, 1, 11, 59, 58, 800000, tzinfo=datetime.timezone.utc)
328328
- [poetry](https://python-poetry.org/docs/#installation)
329329
*Needed to install dependencies in a virtual environment*
330330

331-
- [poethepoet](https://github.com/nat-n/poethepoet) for running development tasks as defined in pyproject.toml
332-
- Can be installed to your host environment via `pip install poethepoet` then executed as simple `poe`
333-
- or run from the poetry venv as `poetry run poe`
331+
- make ([ubuntu](https://www.howtoinstall.me/ubuntu/18-04/make/), [windows](https://stackoverflow.com/questions/32127524/how-to-install-and-use-make-in-windows), [mac](https://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/))
332+
333+
*Needed to conveniently run development tasks.*
334+
*Alternatively, manually run the commands defined in the [Makefile](./Makefile)*
334335

335336
### Setup
336337

@@ -343,14 +344,16 @@ poetry install
343344
poetry shell
344345
```
345346

347+
Run `make help` to see all available development tasks.
348+
346349
### Code style
347350

348351
This project enforces [black](https://github.com/psf/black) python code formatting.
349352

350353
Before committing changes run:
351354

352355
```sh
353-
poe format
356+
make format
354357
```
355358

356359
To avoid merge conflicts later, non-black formatted python code will fail in CI.
@@ -384,15 +387,15 @@ Here's how to run the tests.
384387

385388
```sh
386389
# Generate assets from sample .proto files required by the tests
387-
poe generate
390+
make generate
388391
# Run the tests
389-
poe test
392+
make test
390393
```
391394

392395
To run tests as they are run in CI (with tox) run:
393396

394397
```sh
395-
poe full-test
398+
make full-test
396399
```
397400

398401
### (Re)compiling Google Well-known Types
@@ -413,6 +416,7 @@ protoc \
413416
/usr/local/include/google/protobuf/*.proto
414417
```
415418

419+
416420
### TODO
417421

418422
- [x] Fixed length fields

0 commit comments

Comments
 (0)