From 8d73c9ba29cc6d20a8a02c901e94541afb135f47 Mon Sep 17 00:00:00 2001 From: Artem Revenko Date: Wed, 18 Sep 2019 17:18:05 +0200 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20Treat=20"description"=20key=20the=20?= =?UTF-8?q?same=20way=20as=20"explode"=20key=20for=20query=20and=20h?= =?UTF-8?q?=E2=80=A6=20(#129)=20[Artem=20Revenko]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- flask_rebar/swagger_generation/swagger_generator_v3.py | 3 +++ setup.py | 2 +- .../swagger_generation/registries/exploded_query_string.py | 6 +++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 1b08e77b..462fed3b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.10.0 +current_version = 1.10.1 commit = True tag = True diff --git a/flask_rebar/swagger_generation/swagger_generator_v3.py b/flask_rebar/swagger_generation/swagger_generator_v3.py index b26289a4..8dbf408f 100644 --- a/flask_rebar/swagger_generation/swagger_generator_v3.py +++ b/flask_rebar/swagger_generation/swagger_generator_v3.py @@ -317,6 +317,7 @@ def _convert_schema_to_list_of_parameters(self, schema, converter, in_): # Pardon the ugliness. # We need the "explode" key to be at the parameters level, not at the schema level. explode = jsonschema.pop(sw.explode, None) + description = jsonschema.pop(sw.description, None) parameter = { sw.name: prop, @@ -327,6 +328,8 @@ def _convert_schema_to_list_of_parameters(self, schema, converter, in_): if explode is not None: parameter[sw.explode] = explode + if description is not None: + parameter[sw.description] = description parameters.append(parameter) diff --git a/setup.py b/setup.py index e9033a4a..69f01a35 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ if __name__ == "__main__": setup( name="flask-rebar", - version="1.10.0", + version="1.10.1", author="Barak Alon", author_email="barak.s.alon@gmail.com", description="Flask-Rebar combines flask, marshmallow, and swagger for robust REST services.", diff --git a/tests/swagger_generation/registries/exploded_query_string.py b/tests/swagger_generation/registries/exploded_query_string.py index c093bb54..0f5fcd42 100644 --- a/tests/swagger_generation/registries/exploded_query_string.py +++ b/tests/swagger_generation/registries/exploded_query_string.py @@ -9,7 +9,9 @@ class ExplodedQueryStringSchema(RequestSchema): - foos = QueryParamList(marshmallow.fields.String(), required=True) + foos = QueryParamList( + marshmallow.fields.String(), required=True, description="foo string" + ) @registry.handles( @@ -53,6 +55,7 @@ def get_foos(): "collectionFormat": "multi", "type": "array", "items": {"type": "string"}, + "description": "foo string", } ], } @@ -95,6 +98,7 @@ def get_foos(): "name": "foos", "in": "query", "required": True, + "description": "foo string", "schema": {"type": "array", "items": {"type": "string"}}, "explode": True, } From a3bf084c9e01f04346c53caa5c3c193228918fd6 Mon Sep 17 00:00:00 2001 From: Rick Riensche Date: Wed, 18 Sep 2019 21:27:23 -0700 Subject: [PATCH 2/6] chg: Tweaking build rules, updating docs, and prepping for bumpversion do-over --- .travis.yml | 1 + CONTRIBUTING.rst | 22 +++++++++++++++------- setup.py | 3 ++- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8701b1d4..1daedc65 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,4 +49,5 @@ jobs: password: secure: GoFaAo3a08PoPklGQ68q7EMYE59hb1Z1+PEMuSSXKelL2amyG6/kq5t7r8p6trjFabco1u94IwZFFlmUdfr4PqDQ/eaM9MVF1VvI8dxp/fg3WgSxjtxy4io/ELUWTGXTGs3V8Lp61haRdHjrqk5DwG6SHDVVzjuJBZ4Kydr6fuo0RWu9C4qAkU1MWmoIPeyeB4ZydXimD15uOvMp13UA7SqLUdXlAhwyL7c2h6pihu2gnbLXEnfkh8rlvRT8fSp7PUkFsg3FOvgMZg8dn8/J0I/pTmG7c71v0hacOVTKLsfAtSSHAjgcc8KffvMBOcE/YXgUr+lgR4R181lMqXv2LBNMuE5Gyc8GBjTb8Liiowpvg8XXH86vC/k+0/3toKWPobjsXJCAgR21+B7FFzE8hmZdP43HcSfCqbzS8ELUWF9AvUBlFtdakr0a0wLjcKsJyBNiKwwmw50kKsb7agpIXgS/I0Y6EyGwyXi8/q7IPmR7wffg3bAGnvvg5yz7vOZTGYJnFM+Ky1LdQ7fJ44D+Ze/SraB1syK2pmednX6YVMgIlPU5QpaprmQ9AkeoWmPZBShWl07Js73BnbQKWklkV8yAXq9qy51cjRA9SWQIFzeiHScOwhUalb1CpggOyG1sx4/GMFLg5nNE0ldKDfqUGJ4kbcNh25jiiBEJ7mEQkB0= on: + branch: master tags: true diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 1596efc8..848de21a 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -67,22 +67,30 @@ Pull Requests Releasing to PyPI ----------------- -Travis CI handles releasing package versions to PyPI. +We use Travis CI to automate releasing package versions to PyPI. + +.. warning:: These steps must be completed by an administrator. We generally do at least patch releases fairly frequently, but if you have a feature that urgently requires release, feel free to reach out and request one and we'll do our best to accommodate. + Flask-Rebar uses `semantic versions `_. Once you know the appropriate version part to bump, use the ``bumpversion`` tool which will bump the package version, add a commit, and tag the commit appropriately. Note, it's not a bad idea to do a manual inspection and any cleanup you deem necessary after running ``gitchangelog`` to ensure it looks good before then committing a "@cosmetic" update. +.. note:: Before completing the following steps, you will need to temporarily change settings on GitHub under branch protection rules to NOT include administrators. This is required to allow you to push the changelog update. + .. code-block:: bash - git checkout -b your-release-branch - bumpversion minor + git checkout master + git pull # just to play it safe and make sure you're up to date + bumpversion patch # or major or minor if applicable gitchangelog + # STOP HERE: inspect CHANGELOG.rst and clean up as needed before continuing git commit -a -m "@cosmetic - changelog" - -Then push the new commit and tags: +Then push the new commits and tags: .. code-block:: bash - git push -u origin your-release-branch --tags + git push --tags + +Finally, while you're waiting for Travis CI to pick up the tagged version, build it, and deploy it to PyPi, don't forget to reset branch protection settings (for normal operation, administrators should be subject to these restrictions to enforce PR code review requirements). + -Create a Pull Request and merge back into master. Voila. diff --git a/setup.py b/setup.py index 69f01a35..3800a011 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ if __name__ == "__main__": setup( name="flask-rebar", - version="1.10.1", + version="1.10.0", author="Barak Alon", author_email="barak.s.alon@gmail.com", description="Flask-Rebar combines flask, marshmallow, and swagger for robust REST services.", @@ -43,6 +43,7 @@ "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", "Topic :: Software Development :: Libraries :: Application Frameworks", From 8787f6fb6d45f5962c63070aa272ee40e49b97d5 Mon Sep 17 00:00:00 2001 From: Rick Riensche Date: Wed, 18 Sep 2019 21:44:38 -0700 Subject: [PATCH 3/6] @minor correct current version in bumpversion.cfg --- .bumpversion.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 462fed3b..1b08e77b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.10.1 +current_version = 1.10.0 commit = True tag = True From 8dea2ec6acccd184813401d746e35249c0224a14 Mon Sep 17 00:00:00 2001 From: Rick Riensche Date: Wed, 18 Sep 2019 21:44:45 -0700 Subject: [PATCH 4/6] =?UTF-8?q?Bump=20version:=201.10.0=20=E2=86=92=201.10?= =?UTF-8?q?.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 1b08e77b..462fed3b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.10.0 +current_version = 1.10.1 commit = True tag = True diff --git a/setup.py b/setup.py index 3800a011..1f530abd 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ if __name__ == "__main__": setup( name="flask-rebar", - version="1.10.0", + version="1.10.1", author="Barak Alon", author_email="barak.s.alon@gmail.com", description="Flask-Rebar combines flask, marshmallow, and swagger for robust REST services.", From f5bb2fe8dea742cc27815930c119cc446099d1db Mon Sep 17 00:00:00 2001 From: Rick Riensche Date: Wed, 18 Sep 2019 21:46:01 -0700 Subject: [PATCH 5/6] @cosmetic - changelog --- CHANGELOG.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 17282b36..f82fb484 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,27 @@ Changelog ========= +v1.10.1 (2019-09-19) +-------------------- + +Changes +~~~~~~~ +- Tweaking build rules, updating docs, and prepping for bumpversion do- + over. [Rick Riensche] + +Fix +~~~ +- Treat "description" key the same way as "explode" key for query and h… + (#129) [Artem Revenko] + +Other +~~~~~ +- Accept bare class for schema arguments (#126) [Rick Riensche] +- Fix marshmallow test helpers so that they work will all unittest + compatible frameworks and not just pytest. 'python setup.py test' + works again. (#127) [Andrew Standley] + + v1.10.0 (2019-09-11) -------------------- - BP-763: Add support for multiple authenticators (#122) [Andrew From c549bf3540d820be3992f48dbe081c2e60c7a3bf Mon Sep 17 00:00:00 2001 From: Rick Riensche Date: Wed, 18 Sep 2019 21:53:21 -0700 Subject: [PATCH 6/6] @minor - whoops screwed up git push in doc.. --- CONTRIBUTING.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 848de21a..1304853e 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -89,7 +89,7 @@ Then push the new commits and tags: .. code-block:: bash - git push --tags + git push && git push --tags Finally, while you're waiting for Travis CI to pick up the tagged version, build it, and deploy it to PyPi, don't forget to reset branch protection settings (for normal operation, administrators should be subject to these restrictions to enforce PR code review requirements).