Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Poetry & use Github Actions #2049

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mtraynham
Copy link
Contributor

@mtraynham mtraynham commented Dec 17, 2022

I believe this project is pretty much inactive (#1719) and I'm not sure who owns it (best guess @kragniz / @stephenfin).

This PR brings some of the tooling up to date.

I initially wanted to fork and update the proto/grpc versions (#2045), but the support for Python 2.7, 3.5, 3.6, etc. make it hard to do so. On top of this, some of the testing with pifpaf/subprocess seems a bit flakey. Therefore, I simply pinned all the versions to what was currently in requirements/test.txt and got as many green tests as I could; Python 3.7-3.9 with latest etcd 3.0.X, 3.1.X, 3.2.X, 3.3.X, 3.4.X, 3.5.X.

I likely plan to fork and drop support for Python/etcd/grpc/protobuf versions to accommodate my own app, although I would prefer not to. It's probably inappropriate to have a public library target one specific Python version/etcd version...

This uses Poetry, which is based on PEP 621 – Storing project metadata in pyproject.toml. It also uses Github Actions instead of Travis CI to perform the builds. Tox is dropped simply in favor of utilizing a Makefile and using Github Action matrix testing. If you need to utilize different versions of Python, I'd recommend pyenv or asdf.

With the current setup, testing <3.7 isn't supported by Github Actions & 3.10/3.11 are avoided because the grpc versions don't have wheels.

$ pip install poetry==1.2.2
$ make install lint test clean uninstall
$ make help
──────────────────────── Make Commands ────────────────────────────────
install: install local development dependencies
uninstall: uninstalls local development dependencies
clean: removes intermediate files and build artifacts
lint: lints all code
test: runs the tests
build: builds the project to tar & wheel formats
.etcd: installs etcd locally for running
etcd3/proto: clones the protobuf definitions
etcd3/etcdrpc: generates etcd protobuf definitions
etcd-up: starts etcd
etcd-down: stops etcd
help: show this help

Override etcd version

$ TEST_ETCD_VERSION=v3.5.6 make clean test

Regenerate protobuf

$ make etcd3/etcdrpc

Run etcd in a container

$ make etcd-up  # make etcd-down

image

Some of the tests seem to fail intermittently, but I wanted to avoid test alterations for tooling only.
image

@mtraynham mtraynham force-pushed the poetry_github_actions branch from e3654b2 to ac98a20 Compare December 27, 2022 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant