Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenoak committed Aug 7, 2019
2 parents 45b2944 + 7aa86da commit 0cf0d05
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 33 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.2.0
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generated file, do not edit
marshmallow>=2.19.0,<3
marshmallow>=2.16.0,<3
quaerere-base-common
pytest-runner
Sphinx>=1.8.0,<2
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.1.0
current_version = 0.2.0
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<pre_release>\.dev|a|b|rc)(?P<pre_release_num>\d+))?
serialize =
{major}.{minor}.{patch}{pre_release}{pre_release_num}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

PROJECT_NAME = 'quaerere-willamette-common'
INSTALL_REQUIRES = [
'marshmallow>=2.19.0,<3',
'marshmallow>=2.16.0,<3',
'quaerere-base-common', ]
SETUP_REQUIRES = [
'pytest-runner',
Expand Down
15 changes: 9 additions & 6 deletions tests/test_common.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
from willamette_common import (
WebSiteBase, WebPageBase, WebPageSchema, WebSiteSchema)
from willamette_common.schemas import (
WebSiteFieldsMixinV1,
WebPageFieldsMixinV1,
WebPageSchemaV1,
WebSiteSchemaV1)


def test_web_site():
_ = WebSiteSchema()
_ = WebSiteBase()
_ = WebSiteSchemaV1()
_ = WebSiteFieldsMixinV1()


def test_web_page():
_ = WebPageSchema()
_ = WebPageBase()
_ = WebPageSchemaV1()
_ = WebPageFieldsMixinV1()
2 changes: 1 addition & 1 deletion willamette_common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from .models import *

from .schemas import *
4 changes: 0 additions & 4 deletions willamette_common/models/__init__.py

This file was deleted.

9 changes: 0 additions & 9 deletions willamette_common/models/web_pages.py

This file was deleted.

8 changes: 5 additions & 3 deletions willamette_common/schemas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
__all__ = ['WebPageSchema', 'WebSiteSchema']
__all__ = ['WebPageFieldsMixinV1', 'WebPageSchemaV1', 'WebSiteFieldsMixinV1', 'WebSiteSchemaV1']

from .web_pages import WebPageSchema
from .web_sites import WebSiteSchema
from .api_v1 import WebPageSchema as WebPageSchemaV1
from .api_v1 import WebSiteSchema as WebSiteSchemaV1
from .api_v1.mixins import WebPageFieldsMixin as WebPageFieldsMixinV1
from .api_v1.mixins import WebSiteFieldsMixin as WebSiteFieldsMixinV1
4 changes: 4 additions & 0 deletions willamette_common/schemas/api_v1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
__all__ = ['WebPageSchema', 'WebSiteSchema']

from .web_pages import WebPageSchema
from .web_sites import WebSiteSchema
4 changes: 4 additions & 0 deletions willamette_common/schemas/api_v1/mixins/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
__all__ = ['WebPageFieldsMixin', 'WebSiteFieldsMixin']

from .web_pages import WebPageFieldsMixin
from .web_sites import WebSiteFieldsMixin
9 changes: 9 additions & 0 deletions willamette_common/schemas/api_v1/mixins/web_pages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
__all__ = ['WebPageFieldsMixin']

from marshmallow import fields


class WebPageFieldsMixin:
text = fields.String()
url = fields.Url(required=True)
web_site_key = fields.String(required=True)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
__all__ = ['WebSiteBase']
__all__ = ['WebSiteFieldsMixin']

from marshmallow import fields


class WebSiteBase:
class WebSiteFieldsMixin:
url = fields.Url(required=True)
inLanguage = fields.String()
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from marshmallow import fields
from quaerere_base_common.schema import BaseSchema

from ..models import WebPageBase
from .mixins import WebPageFieldsMixin


class WebPageSchema(BaseSchema, WebPageBase):
class WebPageSchema(WebPageFieldsMixin, BaseSchema):
_key = fields.String()
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from marshmallow import fields
from quaerere_base_common.schema import BaseSchema

from ..models import WebSiteBase
from .mixins import WebSiteFieldsMixin


class WebSiteSchema(BaseSchema, WebSiteBase):
class WebSiteSchema(WebSiteFieldsMixin, BaseSchema):
_key = fields.String()

0 comments on commit 0cf0d05

Please sign in to comment.