Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gmr/consulate
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: python-microservices/consulate
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 7 commits
  • 60 files changed
  • 1 contributor

Commits on Nov 10, 2020

  1. Refactor project (#1)

    * feat: update project
    avara1986 authored Nov 10, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b7239e9 View commit details
  2. chore: updated badges

    avara1986 committed Nov 10, 2020
    Copy the full SHA
    da57e0f View commit details
  3. fix: travis ci

    avara1986 committed Nov 10, 2020
    Copy the full SHA
    9d95a94 View commit details

Commits on May 24, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2c2c5d5 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e3c6462 View commit details
  3. Update python-package.yml

    avara1986 authored May 24, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8dbd5c6 View commit details

Commits on May 25, 2024

  1. bump version 1.1.0

    avara1986 committed May 25, 2024
    Copy the full SHA
    b512466 View commit details
Showing with 3,052 additions and 2,019 deletions.
  1. +38 −0 .github/ISSUE_TEMPLATE/bug_report.md
  2. +20 −0 .github/ISSUE_TEMPLATE/feature_request.md
  3. +5 −0 .github/PULL_REQUEST_TEMPLATE.md
  4. +48 −0 .github/workflows/python-package.yml
  5. +1 −0 .gitignore
  6. +14 −74 .travis.yml
  7. +1 −58 CONTRIBUTING.md
  8. +13 −0 Pipfile
  9. +867 −0 Pipfile.lock
  10. +7 −6 README.rst
  11. +0 −84 bootstrap
  12. +0 −10 consulate.iml
  13. +21 −24 consulate/__init__.py
  14. +16 −26 consulate/adapters.py
  15. +3 −14 consulate/api/__init__.py
  16. +116 −120 consulate/api/acl.py
  17. +85 −76 consulate/api/agent.py
  18. +31 −38 consulate/api/base.py
  19. +20 −25 consulate/api/catalog.py
  20. +25 −25 consulate/api/coordinate.py
  21. +10 −18 consulate/api/event.py
  22. +8 −9 consulate/api/health.py
  23. +51 −60 consulate/api/kv.py
  24. +10 −12 consulate/api/lock.py
  25. +13 −19 consulate/api/session.py
  26. +2 −2 consulate/api/status.py
  27. +204 −248 consulate/cli.py
  28. +31 −34 consulate/client.py
  29. +104 −111 consulate/models/acl.py
  30. +77 −162 consulate/models/agent.py
  31. +31 −31 consulate/models/base.py
  32. +7 −21 consulate/utils.py
  33. +9 −8 docker-compose.yml
  34. +11 −9 docs/conf.py
  35. +467 −0 pylintrc
  36. +16 −0 pyproject.toml
  37. +0 −1 requires/installation.txt
  38. +0 −1 requires/optional.txt
  39. +0 −10 requires/testing.txt
  40. +16 −13 setup.cfg
  41. +70 −30 setup.py
  42. +0 −14 tests/__init__.py
  43. +16 −12 tests/base.py
  44. +0 −139 tests/base_model_tests.py
  45. +0 −11 tests/catalog_tests.py
  46. +38 −0 tests/conftest.py
  47. +16 −0 tests/consul.json
  48. +0 −18 tests/event_tests.py
  49. +48 −60 tests/{acl_tests.py → test_acl.py}
  50. +74 −98 tests/{agent_tests.py → test_agent.py}
  51. +94 −139 tests/{api_tests.py → test_api.py}
  52. +104 −0 tests/test_base_model.py
  53. +9 −0 tests/test_catalog.py
  54. +1 −0 tests/{coordinate_tests.py → test_coordinate.py}
  55. +12 −0 tests/test_event.py
  56. +76 −111 tests/{kv_tests.py → test_kv.py}
  57. 0 tests/{lock_tests.py → test_lock.py}
  58. +6 −11 tests/{session_tests.py → test_session.py}
  59. +70 −0 tests/test_utils.py
  60. +20 −27 tests/utils_tests.py
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Fixes # [refer the issue number]

Changes proposed in this PR:
- [Updated X functionality]
- [Refactor X class]
48 changes: 48 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install --dev --system
- name: Test with pytest
run: |
python setup.py test
- name: Run mypy
continue-on-error: true
run: |
mypy consulate
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 consulate --show-source --statistics
- name: Lint with pylint
run: |
pylint --rcfile=pylintrc consulate
- name: Security safety
run: |
safety check
- name: Security bandit
run: |
bandit -r consulate/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -12,3 +12,4 @@ cover
docs/_build
MANIFEST
venv
htmlcov
88 changes: 14 additions & 74 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,18 @@
sudo: required

services:
- docker

language: python

env:
global:
- PATH=$HOME/.local/bin:$PATH
- AWS_DEFAULT_REGION=us-east-1
- secure: "GxBrm8hKFLazshbB3c+rQUQYHAim/rm8KtBXz6uNWRvsccAK6otc5Wcz01kj679d9C9L3I/G6/wCxfgglQp3YMGKlLT+jHQpOMdDauEdeKvaUuPh3hDQBPSAUhIpycgxz9AghdWqOQGkpQQqNW9UZRC42SW2eIyWFIlQf6W31Vc="
- secure: "YdDXZGAOp1WZenhfZnHhL9cOeUQbvZZOr8FWWJoJz3EdTbf6jE2UuK4HU6CgoYDpfFlc7geah2xARr/2rkN716Rz4ZzeHBtNXfwqqQRWRLkB8J73Nowmm+6J+skv6meJyCHtcHalpv7pAH5QPn3zMK2EAogdcDJmd5GSVBjwPoo="

stages:
- test
- name: upload coverage
- name: deploy
if: tag IS present

python:
- "3.8"
install:
- pip install awscli
- pip install -r requires/testing.txt
- python setup.py develop

before_script:
- ./bootstrap
- source build/test-environment

script: nosetests

- python -m pip install --upgrade pip
- pip install --upgrade setuptools coveralls pipenv
- pipenv lock --dev --requirements > requirements.txt
- pip install -r requirements.txt
script:
- coverage erase
- python setup.py test
after_success:
- aws s3 cp .coverage "s3://com-gavinroy-travis/consulate/$TRAVIS_BUILD_NUMBER/.coverage.${TRAVIS_PYTHON_VERSION}"
- coverage combine
- coveralls

jobs:
include:
- python: 2.7
- python: 3.4
- python: 3.5
- python: 3.6
- python: pypy
- python: pypy3
- stage: upload coverage
if: repo IS gmr/consulate
sudo: false
services: []
python: 3.6
install:
- pip install awscli coverage codecov
before_script: true
script:
- mkdir coverage
- aws s3 cp --recursive s3://com-gavinroy-travis/consulate/$TRAVIS_BUILD_NUMBER/
coverage
- cd coverage
- coverage combine
- cd ..
- mv coverage/.coverage .
- coverage report
after_success: codecov
- stage: deploy
sudo: false
if: repo IS gmr/consulate
python: 3.6
services: []
install: true
before_script: true
script: true
after_success: true
deploy:
distributions: sdist bdist_wheel
provider: pypi
user: crad
on:
tags: true
all_branches: true
password:
secure: "W3mHi2tzX34KcN82tdVPZwS0RHBGkI2Cy/df18ehsVKoOzWzQvaQKh2Jh1LIBOvdZCyih+KltmMNT8ounqUd+ql6kBFd0kotQk3C3x5R5KlpbhQ4BNKp++grs+iycPwK6qnJISypt2d3ykJNgqUgfBI0p+7XVpMkBY0GIXGNcvk="
notifications:
email:
- a.vara.1986@gmail.com
59 changes: 1 addition & 58 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,3 @@
# Contributing

## Test Coverage

To contribute to Consulate, please make sure that any new features or changes
to existing functionality **include test coverage**.

*Pull requests that add or change code without coverage have a much lower chance
of being accepted.*

## Prerequisites

Consulate test suite has a couple of requirements:

* Dependencies from [requires/testing.txt](requires/testing.txt) are installed
* Local Docker and [docker-compose](https://docs.docker.com/compose/)

## Installing Dependencies

You may want to develop in a virtual environment. This is usually done inside the source
repository, and `.gitignore` is configured to ignore a virtual environment in `env`.

```bash
python3 -m venv env
source env/bin/activate
```

To install the dependencies needed to run Consulate tests, use

```bash
pip install -r requires/testing.txt
```

## Starting the test dependency

Prior to running tests, ensure that Consul is running via Docker using:

```bash
./bootstrap
```

This script uses [docker-compose](https://docs.docker.com/compose/) to launch a Consul server container that is
pre-configured for the tests. In addition, it configures `build/test-environment` that is loaded
by the tests with configuration information for connecting to Consul.

## Running Tests

To run all test suites, run:

nosetests

## Code Formatting

Please format your code using [yapf](http://pypi.python.org/pypi/yapf)
with ``pep8`` style prior to issuing your pull request. In addition, run
``flake8`` to look for any style errors prior to submitting your PR.

Both are included when the test requirements are installed. If you are fixing
formatting for existing code, please separate code-reformatting commits from
functionality changes.
See this [webpage](https://python-microservices.github.io/contributing/)
13 changes: 13 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
py-ms-consulate = {editable = true,extras = ["tests"],path = "."}

[packages]
py-ms-consulate = {editable = true, extras = ["unixsocket"],path = "."}

[pipenv]
allow_prereleases = true
Loading