Skip to content

Implement asyncio support, plus session optimizations #87

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

Open
wants to merge 16 commits 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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ workflows:
- test:
matrix:
parameters:
python-version: ["2.7", "3.7", "3.8", "3.9"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing EOL python, adding current python.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ _docs/_build/

# PyBuilder
target/

# dev
.idea
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ lint:
flake8 contentful

test:
python setup.py test
python -m unittest discover tests

Comment on lines -51 to 52
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup.py is deprecated.

test-all:
tox

coverage:
coverage run --source contentful setup.py test
coverage run -m unittest discover tests
coverage report -m
flake8 contentful

Expand All @@ -77,9 +77,13 @@ git-docs: docs
git commit --amend -C HEAD

release: clean git-docs
python setup.py publish
$(eval VERSION := $(shell poetry version -s))
poetry publish --build --no-interaction
git tag -a $(VERSION) -m "version $(VERSION)"
git push --tags
git push


dist: clean
python setup.py sdist
python setup.py bdist_wheel
poetry build --no-interaction
ls -l dist
47 changes: 33 additions & 14 deletions contentful/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
from .client import Client # noqa: F401
from .entry import Entry # noqa: F401
from .asset import Asset # noqa: F401
from .space import Space # noqa: F401
from .locale import Locale # noqa: F401
from .resource import Link # noqa: F401
from .content_type import ContentType # noqa: F401
from .deleted_asset import DeletedAsset # noqa: F401
from .deleted_entry import DeletedEntry # noqa: F401
from .content_type_cache import ContentTypeCache # noqa: F401
from .content_type_field import ContentTypeField # noqa: F401
# flake8: noqa
from importlib import metadata

from .client import Client, AsyncClient
from .entry import Entry
from .asset import Asset
from .space import Space
from .locale import Locale
from .resource import Link
from .content_type import ContentType
from .deleted_asset import DeletedAsset
from .deleted_entry import DeletedEntry
from .content_type_cache import ContentTypeCache
from .content_type_field import ContentTypeField

__version__ = "2.1.1"
__author__ = "Contentful GmbH"
__email__ = "[email protected]"
__all__ = (
"Client",
"AsyncClient",
"Entry",
"Asset",
"Space",
"Locale",
"Link",
"ContentType",
"DeletedAsset",
"DeletedEntry",
"ContentTypeCache",
"ContentTypeField",
)

_metadata = metadata.metadata(__package__)

__version__ = _metadata.get("version")
__author__ = _metadata.get("author")
__email__ = _metadata.get("author-email")
Comment on lines +16 to +35
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defining an __all__ and using importlib.metadata to get package metadata.

Loading