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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .build.yml

This file was deleted.

11 changes: 0 additions & 11 deletions setup.cfg → .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,3 @@ message = Release: {current_version} -> {new_version}
[bumpversion:file:setup.py]

[bumpversion:file:etcd3/__init__.py]

[bdist_wheel]
universal = 1

[flake8]
exclude = docs
builtins = long

[coverage:run]
omit = etcd3/etcdrpc/*

60 changes: 0 additions & 60 deletions .dockerignore

This file was deleted.

14 changes: 14 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[flake8]
exclude =
.venv,
.git,
.tox,
dist,
docs,
*lib/python*,
*egg,
build,
etcd3/etcdrpc/
application-import-names = etcd3
ignore = D1, W503
builtins = long
69 changes: 69 additions & 0 deletions .github/workflows/prgate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
name: prgate
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
python:
- '3.7'
- '3.8'
- '3.9'
# - '3.10'
# - '3.11'
etcd:
- 'v3.0.17'
- 'v3.1.20'
- 'v3.2.32'
- 'v3.3.10'
- 'v3.3.27'
- 'v3.4.22'
- 'v3.5.6'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Install python dependencies
run: pip install poetry==1.2.2

- name: Cache virtualenv dependencies across builds
uses: actions/cache@v3
with:
path: |
.venv
key: ${{ github.repository }}-${{ runner.os }}-${{ matrix.python }}-venv-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ github.repository }}-${{ runner.os }}-${{ matrix.python }}-venv-

- name: Cache etcd across builds
uses: actions/cache@v3
with:
path: |
.etcd
key: ${{ github.repository }}-${{ runner.os }}-etcd-${{ matrix.etcd }}
restore-keys: |
${{ github.repository }}-${{ runner.os }}-etcd-${{ matrix.etcd }}

- name: Install dependencies
run: make install

- name: Lint code
run: make lint

- name: Run tests
run: make test
env:
TEST_ETCD_VERSION: ${{ matrix.etcd }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ target/
# Editor files
.sw?
.idea/
*.iml

# etcd
.etcd
47 changes: 11 additions & 36 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,18 @@ Get Started!

Ready to contribute? Here's how to set up `python-etcd3` for local development.

This project uses ``poetry==1.2.2`` (https://python-poetry.org/) for hard-pinning dependencies versions.
Please see its documentation for usage instructions.

1. Fork the `python-etcd3` repo on GitHub.
2. Clone your fork locally::

$ git clone [email protected]:your_name_here/python-etcd3.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::

$ mkvirtualenv etcd3
$ cd etcd3/
$ python setup.py develop
$ cd python-etcd3/
$ make install

4. Create a branch for local development::

Expand All @@ -78,11 +80,7 @@ Ready to contribute? Here's how to set up `python-etcd3` for local development.

5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::

$ flake8 etcd3 tests
$ python setup.py test or py.test
$ tox

To get flake8 and tox, just pip install them into your virtualenv.
$ make lint test

6. Commit your changes and push your branch to GitHub::

Expand All @@ -101,22 +99,17 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4 and 3.5, and for PyPy. Check
https://travis-ci.org/kragniz/python-etcd3/pull_requests
3. The pull request should work for Python 2.7, 3.5, 3.6, 3.7, 3.8, and 3.9. Check
https://github.com/kragniz/python-etcd3/actions
and make sure that the tests pass for all supported Python versions.

Generating protobuf stubs
-------------------------

If the upstream protobuf files changes, copy the stubs::

$ cp etcd/etcdserver/etcdserverpb/*.proto python-etcd3/etcd3/proto/

Then::

$ cd python-etcd3
$ tox -e genproto
If the upstream protobuf files changes, copy the stubs and regenerate the python::

$ rm -r etcd3/proto
$ make etcd3/etcdrpc

Cutting new releases
--------------------
Expand Down Expand Up @@ -144,21 +137,3 @@ The release process to PyPi is automated using travis deploys and bumpversion.
$ git push --tags

4. Wait for travis tests to run and deploy to PyPI


Dependency management
---------------------

This project uses ``pip-compile-multi`` (https://pypi.org/project/pip-compile-multi/) for hard-pinning dependencies versions.
Please see its documentation for usage instructions.
In short, ``requirements/base.in`` contains the list of direct requirements with occasional version constraints (like ``Django<2``)
and `requirements/base.txt` is automatically generated from it by adding recursive tree of dependencies with fixed versions.
The same goes for ``test`` and ``dev``.

To upgrade dependency versions, run ``pip-compile-multi``.

To add a new dependency without upgrade, add it to `requirements/base.in` and run `pip-compile-multi --no-upgrade`.

For installation always use ``.txt`` files. For example, command ``pip install -Ue . -r requirements/dev.txt`` will install
this project in development mode, testing requirements and development tools.
Another useful command is ``pip-sync requirements/dev.txt``, it uninstalls packages from your virtualenv that aren't listed in the file.
25 changes: 0 additions & 25 deletions Dockerfile

This file was deleted.

15 changes: 0 additions & 15 deletions MANIFEST.in

This file was deleted.

Loading