pillar-python-sdk.git
2 weeks agoUse remove_private_keys() instead of popping predefined keys master
Sybren A. Stüvel [Fri, 31 May 2019 15:02:48 +0000 (17:02 +0200)]
Use remove_private_keys() instead of popping predefined keys

2 weeks agoUpdated changelog v1.10
Sybren A. Stüvel [Fri, 31 May 2019 12:20:40 +0000 (14:20 +0200)]
Updated changelog

2 weeks agoBumped version to 1.10
Sybren A. Stüvel [Fri, 31 May 2019 12:20:36 +0000 (14:20 +0200)]
Bumped version to 1.10

2 weeks agoAllow PATCHing users
Sybren A. Stüvel [Fri, 31 May 2019 12:19:24 +0000 (14:19 +0200)]
Allow PATCHing users

This is used to set the username from the settings view.

2 weeks agoMark User.gravatar() as deprecated
Sybren A. Stüvel [Fri, 31 May 2019 12:18:40 +0000 (14:18 +0200)]
Mark User.gravatar() as deprecated

We're using self-hosted avatars instead.
See `pillar.api.users.avatar.url()` in the Pillar source code instead.

3 weeks agoBumped version to 1.9
Sybren A. Stüvel [Tue, 28 May 2019 14:12:32 +0000 (16:12 +0200)]
Bumped version to 1.9

3 weeks agoBumped version to 1.9
Sybren A. Stüvel [Tue, 28 May 2019 14:12:22 +0000 (16:12 +0200)]
Bumped version to 1.9

4 weeks agoRemoved and gitignored poetry.lock
Sybren A. Stüvel [Thu, 23 May 2019 14:23:45 +0000 (16:23 +0200)]
Removed and gitignored poetry.lock

The poetry.lock files are only relevant for repeatable deployments,
and the one in this project isn't used for that (only the Blender
Cloud project file is used, and that's still there).

5 weeks agoLoosened dependencies and selected now-latest versions
Sybren A. Stüvel [Fri, 10 May 2019 11:42:59 +0000 (13:42 +0200)]
Loosened dependencies and selected now-latest versions

5 weeks agoBumped version to 1.8 v1.8
Sybren A. Stüvel [Tue, 14 May 2019 09:03:28 +0000 (11:03 +0200)]
Bumped version to 1.8

5 weeks agoUpdated update_version.sh to use Poetry
Sybren A. Stüvel [Fri, 10 May 2019 13:17:12 +0000 (15:17 +0200)]
Updated update_version.sh to use Poetry

5 weeks agoDocument usage of Poetry
Sybren A. Stüvel [Fri, 10 May 2019 13:00:05 +0000 (15:00 +0200)]
Document usage of Poetry

5 weeks agoBumped version to 1.8dev0
Sybren A. Stüvel [Fri, 10 May 2019 12:59:22 +0000 (14:59 +0200)]
Bumped version to 1.8dev0

5 weeks agoFix compatibility with Tox
Sybren A. Stüvel [Fri, 10 May 2019 11:55:22 +0000 (13:55 +0200)]
Fix compatibility with Tox

This may require you to delete your `.tox` directory for a clean run.

7 weeks agoMoving to Poetry
Sybren A. Stüvel [Fri, 26 Apr 2019 13:50:41 +0000 (15:50 +0200)]
Moving to Poetry

2 months agoUse remove_private_keys() instead of explicitly popping off certain keys last-before-poetry
Sybren A. Stüvel [Thu, 18 Apr 2019 15:12:22 +0000 (17:12 +0200)]
Use remove_private_keys() instead of explicitly popping off certain keys

3 months agoBumped some secondary requirements
Sybren A. Stüvel [Thu, 7 Mar 2019 16:40:06 +0000 (17:40 +0100)]
Bumped some secondary requirements

The cryptography package was getting old, and since Flamenco is going to
issue JWT tokens soon, I wanted to be up to date with security fixes.

3 months agoNotifications regression: Notifications not created
Tobias Johansson [Tue, 19 Feb 2019 13:16:28 +0000 (14:16 +0100)]
Notifications regression: Notifications not created

Notifications for when someone posted a comment on your node
was not created.

Root cause was that default values defined in schema was not set,
resulting in activity subscriptions not being active.
There were 2 bugs preventing them to be set:
* The way the caching of markdown as html was implemented caused
  default values not to be set.
* Eve/Cerberus regression causes nested default values to fail
  https://github.com/pyeve/eve/issues/1174

Also, a 3rd bug caused nodes without a parent not to have a
subscription.

Migration scripts:
How markdown fields is cached has changed, and unused properties
of attachments has been removed.
./manage.py maintenance replace_pillar_node_type_schemas

Set the default values of activities-subscription
./manage.py maintenance fix_missing_activities_subscription_defaults

9 months agoMarked 1.7.0 as released version-1.7.0
Sybren A. Stüvel [Mon, 17 Sep 2018 16:45:26 +0000 (18:45 +0200)]
Marked 1.7.0 as released

9 months agoAdd support (and fix bug) for Python 3.7
Sybren A. Stüvel [Mon, 17 Sep 2018 16:44:34 +0000 (18:44 +0200)]
Add support (and fix bug) for Python 3.7

9 months agoIgnore .pytest_cache
Sybren A. Stüvel [Wed, 29 Aug 2018 12:21:45 +0000 (14:21 +0200)]
Ignore .pytest_cache

9 months agoUpgrade pyasn1 0.2.3 → 0.4.4
Sybren A. Stüvel [Wed, 29 Aug 2018 12:21:23 +0000 (14:21 +0200)]
Upgrade pyasn1 0.2.3 → 0.4.4

17 months agoAdded support for `datetime` objects in API requests.
Sybren A. Stüvel [Wed, 27 Dec 2017 10:27:43 +0000 (11:27 +0100)]
Added support for `datetime` objects in API requests.

21 months agoBumped version to 1.7 (but not yet released)
Sybren A. Stüvel [Tue, 19 Sep 2017 11:44:04 +0000 (13:44 +0200)]
Bumped version to 1.7 (but not yet released)

21 months agoAdded pickle support for Resource classes, albeit a bit hacky.
Sybren A. Stüvel [Tue, 19 Sep 2017 11:43:48 +0000 (13:43 +0200)]
Added pickle support for Resource classes, albeit a bit hacky.

Unpickling requires the class to be known, so we can't simply use to_dict()
to pickle and pass the dict to __init__() to unpickle. This works for the
pickled object itself (as pickle restores its type), but fails to restore
the class of subobjects, such as some_node.picture. This is why the code
now pickles each subobject too.

21 months agoRemoved Resource.from_dict(), it was never used and is broken in Python 3.
Sybren A. Stüvel [Tue, 19 Sep 2017 10:25:43 +0000 (12:25 +0200)]
Removed Resource.from_dict(), it was never used and is broken in Python 3.

21 months agoUpgraded cryptography package 1.8.1 → 2.0.3
Sybren A. Stüvel [Tue, 5 Sep 2017 11:48:19 +0000 (13:48 +0200)]
Upgraded cryptography package 1.8.1 → 2.0.3

This is for Windows-compatibility, addressed by @dfelinto.

21 months agoRemoved some unsupported resource methods from Organizations
Sybren A. Stüvel [Thu, 31 Aug 2017 11:45:39 +0000 (13:45 +0200)]
Removed some unsupported resource methods from Organizations

2 years agoProject: made has_method() safe for when allowed_methods doesn't exist.
Sybren A. Stüvel [Thu, 1 Jun 2017 07:51:10 +0000 (09:51 +0200)]
Project: made has_method() safe for when allowed_methods doesn't exist.

2 years agoUpgrade cryptography and cffi
Francesco Siddi [Tue, 11 Apr 2017 10:08:18 +0000 (12:08 +0200)]
Upgrade cryptography and cffi

2 years agoDocumented support for Python 3.6, and added warning about Python 2.7
Sybren A. Stüvel [Tue, 7 Mar 2017 13:42:53 +0000 (14:42 +0100)]
Documented support for Python 3.6, and added warning about Python 2.7

2 years agoUpgraded some dev dependencies
Sybren A. Stüvel [Tue, 7 Mar 2017 13:22:32 +0000 (14:22 +0100)]
Upgraded some dev dependencies

To sync up with Pillar dependency versions. Also marked coverage as secondary dependency (because it is).

2 years agoUpgrade cryptography and pyopenssl
Francesco Siddi [Tue, 7 Mar 2017 11:52:01 +0000 (12:52 +0100)]
Upgrade cryptography and pyopenssl

Fixes TypeError: cannot instantiate ctype 'EVP_MD_CTX' of unknown size.

2 years agoRemove Linux specific venv requirements
Francesco Siddi [Tue, 7 Mar 2017 11:51:00 +0000 (12:51 +0100)]
Remove Linux specific venv requirements

When installing on macOS gives errors.

2 years agoUpgraded requests library
Sybren A. Stüvel [Fri, 3 Mar 2017 13:53:02 +0000 (14:53 +0100)]
Upgraded requests library

Was needed to upgrade development requirements for Pillar.

2 years agoReverted to cryptography 1.4
Sybren A. Stüvel [Fri, 3 Mar 2017 13:39:39 +0000 (14:39 +0100)]
Reverted to cryptography 1.4

We were suffering from the same error as described on
https://github.com/burnash/gspread/issues/407

2 years agoAdded '-e .' to requirements-dev.txt
Sybren A. Stüvel [Fri, 3 Mar 2017 11:24:17 +0000 (12:24 +0100)]
Added '-e .' to requirements-dev.txt

This saves you from doing 'pip install -e .' when setting up a new
development environment.

2 years agoAlso test on Python 3.6
Sybren A. Stüvel [Fri, 3 Mar 2017 11:23:45 +0000 (12:23 +0100)]
Also test on Python 3.6

2 years agoSplit requirements.txt in runtime & development
Sybren A. Stüvel [Fri, 3 Mar 2017 11:19:49 +0000 (12:19 +0100)]
Split requirements.txt in runtime & development

Also added secondary requirements to the files.

2 years agoEither raise or log, not both
Sybren A. Stüvel [Fri, 3 Mar 2017 11:19:27 +0000 (12:19 +0100)]
Either raise or log, not both

2 years agoFixed some package version conflicts between Pillar and the SDK.
Sybren A. Stüvel [Mon, 7 Nov 2016 09:56:07 +0000 (10:56 +0100)]
Fixed some package version conflicts between Pillar and the SDK.

2 years agoSwitched to different datetime formatting in JSON.
Sybren A. Stüvel [Mon, 7 Nov 2016 09:55:49 +0000 (10:55 +0100)]
Switched to different datetime formatting in JSON.

We now use the same format as the Pillar API.

2 years agoUse our PillarJSONEncoder for all API requests.
Sybren A. Stüvel [Mon, 7 Nov 2016 09:41:33 +0000 (10:41 +0100)]
Use our PillarJSONEncoder for all API requests.

2 years agoBumped version to 1.6.1 version-1.6.1
Sybren A. Stüvel [Fri, 4 Nov 2016 11:37:43 +0000 (12:37 +0100)]
Bumped version to 1.6.1

2 years agoFix crash when project has no allowed_methods property
Sybren A. Stüvel [Thu, 27 Oct 2016 07:29:49 +0000 (09:29 +0200)]
Fix crash when project has no allowed_methods property

2 years agoFix crash when node has no allowed_methods property
Sybren A. Stüvel [Thu, 27 Oct 2016 07:29:34 +0000 (09:29 +0200)]
Fix crash when node has no allowed_methods property

2 years agoAdded class for Activity.
Sybren A. Stüvel [Wed, 12 Oct 2016 12:30:05 +0000 (14:30 +0200)]
Added class for Activity.

2 years agoBumped version to 1.6.0
Sybren A. Stüvel [Tue, 4 Oct 2016 14:26:23 +0000 (16:26 +0200)]
Bumped version to 1.6.0

2 years agoUpdated changelog
Sybren A. Stüvel [Tue, 4 Oct 2016 14:25:05 +0000 (16:25 +0200)]
Updated changelog

2 years agoAdded Project.find_by_url(project_url) because it's so commonly used as ID
Sybren A. Stüvel [Tue, 20 Sep 2016 10:35:42 +0000 (12:35 +0200)]
Added Project.find_by_url(project_url) because it's so commonly used as ID

2 years agoAlways verify SSL connections.
Sybren A. Stüvel [Fri, 5 Aug 2016 14:10:43 +0000 (16:10 +0200)]
Always verify SSL connections.

Strangely enough, without verify=True we get:
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

2 years agoRemoved long-unused code
Sybren A. Stüvel [Fri, 5 Aug 2016 14:09:33 +0000 (16:09 +0200)]
Removed long-unused code

2 years agoAllow PATCHing nodes.
Sybren A. Stüvel [Thu, 28 Jul 2016 09:28:32 +0000 (11:28 +0200)]
Allow PATCHing nodes.

2 years agoBumped to 1.5.0 (part 2) version-1.5.0
Sybren A. Stüvel [Tue, 26 Jul 2016 13:29:21 +0000 (15:29 +0200)]
Bumped to 1.5.0 (part 2)

2 years agoBumped version to 1.5.0
Sybren A. Stüvel [Tue, 26 Jul 2016 13:27:53 +0000 (15:27 +0200)]
Bumped version to 1.5.0

2 years agoBumped version to 1.5.0-beta1
Sybren A. Stüvel [Tue, 26 Jul 2016 08:58:05 +0000 (10:58 +0200)]
Bumped version to 1.5.0-beta1

2 years agoDon't gobble up the exceptions.BadRequest exception
Sybren A. Stüvel [Tue, 26 Jul 2016 08:57:55 +0000 (10:57 +0200)]
Don't gobble up the exceptions.BadRequest exception

2 years agoPrevented error when response doesn't have _items.
Sybren A. Stüvel [Thu, 21 Jul 2016 14:34:52 +0000 (16:34 +0200)]
Prevented error when response doesn't have _items.

2 years agoEnable global HTTP headers to be sent with every request.
Sybren A. Stüvel [Wed, 20 Jul 2016 12:27:45 +0000 (14:27 +0200)]
Enable global HTTP headers to be sent with every request.

2 years agoEnsure projection of node permissions
Sybren A. Stüvel [Wed, 13 Jul 2016 14:51:13 +0000 (16:51 +0200)]
Ensure projection of node permissions

2 years agoUsing HTTP OPTIONS call for Project.node_type_has_method()
Sybren A. Stüvel [Wed, 13 Jul 2016 14:02:55 +0000 (16:02 +0200)]
Using HTTP OPTIONS call for Project.node_type_has_method()

2 years agoPEP8 formatting
Sybren A. Stüvel [Wed, 13 Jul 2016 13:10:22 +0000 (15:10 +0200)]
PEP8 formatting

2 years agoBumped version to 1.4.0 version-1.4.0
Sybren A. Stüvel [Wed, 13 Jul 2016 09:05:08 +0000 (11:05 +0200)]
Bumped version to 1.4.0

2 years agoAdded exception for 413 Request Entity Too Large
Sybren A. Stüvel [Fri, 8 Jul 2016 10:31:40 +0000 (12:31 +0200)]
Added exception for 413 Request Entity Too Large

2 years agoUse dict for HTTP status code → exception mapping.
Sybren A. Stüvel [Fri, 8 Jul 2016 10:31:21 +0000 (12:31 +0200)]
Use dict for HTTP status code → exception mapping.

2 years agoNode: removed 'theatre_link'
Sybren A. Stüvel [Thu, 7 Jul 2016 14:59:23 +0000 (16:59 +0200)]
Node: removed 'theatre_link'

2 years agoPut a dummy NodeType back (FOR NOW!)
Sybren A. Stüvel [Thu, 7 Jul 2016 13:39:58 +0000 (15:39 +0200)]
Put a dummy NodeType back (FOR NOW!)

2 years agoAdded Node.share() and Node.get_share_links() methods.
Sybren A. Stüvel [Thu, 7 Jul 2016 13:18:26 +0000 (15:18 +0200)]
Added Node.share() and Node.get_share_links() methods.

2 years agoRemoved the obsolete NodeType class.
Sybren A. Stüvel [Thu, 7 Jul 2016 13:04:46 +0000 (15:04 +0200)]
Removed the obsolete NodeType class.

2 years agoSplit Node.create_asset_from_file and added direct uploading from file obj
Sybren A. Stüvel [Thu, 7 Jul 2016 09:08:30 +0000 (11:08 +0200)]
Split Node.create_asset_from_file and added direct uploading from file obj

Node.create_asset_from_file() is split such that the actual file upload is
handled by File.upload_to_project(). This now also supports directly
uploading from a file object, which could be an io.BytesIO() object to
upload from RAM.

2 years agoActually use the 'extra_where' option.
Sybren A. Stüvel [Wed, 6 Jul 2016 14:18:34 +0000 (16:18 +0200)]
Actually use the 'extra_where' option.

2 years agocreate_asset_from_file: added extra_where param to limit updatable nodes.
Sybren A. Stüvel [Tue, 5 Jul 2016 15:28:19 +0000 (17:28 +0200)]
create_asset_from_file: added extra_where param to limit updatable nodes.

2 years agocreate_asset_from_file: allow parent_node_id=None
Sybren A. Stüvel [Tue, 5 Jul 2016 15:27:50 +0000 (17:27 +0200)]
create_asset_from_file: allow parent_node_id=None

Also added more documentation.

2 years agoAdded Node.create_asset_from_file() utility function
Sybren A. Stüvel [Tue, 5 Jul 2016 14:47:51 +0000 (16:47 +0200)]
Added Node.create_asset_from_file() utility function

This also adds some unittests using the Responses library.

2 years agoPorted utils.remove_private_keys() from Pillar
Sybren A. Stüvel [Tue, 5 Jul 2016 14:30:34 +0000 (16:30 +0200)]
Ported utils.remove_private_keys() from Pillar

2 years agoDatetimes are now returned as timezone-aware.
Sybren A. Stüvel [Wed, 29 Jun 2016 14:49:19 +0000 (16:49 +0200)]
Datetimes are now returned as timezone-aware.

Timezone is hardcoded as UTC for now, as Pillar always returns UTC times.

2 years agoAdded pillarsdk.utils.is_valid_id(some_id) function.
Sybren A. Stüvel [Wed, 29 Jun 2016 11:05:04 +0000 (13:05 +0200)]
Added pillarsdk.utils.is_valid_id(some_id) function.

This allows Pillar-Web to check for ID validity before sending IDs
from the URL to Pillar.

2 years agoBumped version to 1.3.0 version-1.3.0
Sybren A. Stüvel [Tue, 28 Jun 2016 13:28:06 +0000 (15:28 +0200)]
Bumped version to 1.3.0

2 years agoRemove testing on Python 3.4, as Ubuntu's default 3.x is now 3.5.
Sybren A. Stüvel [Tue, 28 Jun 2016 13:24:05 +0000 (15:24 +0200)]
Remove testing on Python 3.4, as Ubuntu's default 3.x is now 3.5.

3 years agoEnsure Resource.find_first returns an object of the correct type.
Sybren A. Stüvel [Fri, 17 Jun 2016 12:29:16 +0000 (14:29 +0200)]
Ensure Resource.find_first returns an object of the correct type.

3 years agoAlso expose ForbiddenAccess exception
Sybren A. Stüvel [Fri, 17 Jun 2016 12:29:03 +0000 (14:29 +0200)]
Also expose ForbiddenAccess exception

3 years agoForce projection of Project.category and Project.user.
Sybren A. Stüvel [Wed, 15 Jun 2016 13:12:11 +0000 (15:12 +0200)]
Force projection of Project.category and Project.user.

This is required for finding the home project.

3 years agoSeparated api.get() from utils.convert_datetime() call.
Sybren A. Stüvel [Tue, 31 May 2016 15:58:13 +0000 (17:58 +0200)]
Separated api.get() from utils.convert_datetime() call.

Both are equally likely to fail, so now we can see which from the stack
trace and the line number.

3 years agoAdded Resource.new(dict_or_resource) class method.
Sybren A. Stüvel [Tue, 31 May 2016 15:57:40 +0000 (17:57 +0200)]
Added Resource.new(dict_or_resource) class method.

This allows one to up-cast a Resource to a File, Project, Node, etc.

3 years agoPrevent KeyError when thumbnail has no link.
Sybren A. Stüvel [Tue, 31 May 2016 15:57:08 +0000 (17:57 +0200)]
Prevent KeyError when thumbnail has no link.

This can happen when the link isn't refreshing properly. It's better to
show an empty thumbnail than a 500 Internal Server Error.

3 years agoAdded exception for HTTP 412/Precondition Failed
Sybren A. Stüvel [Mon, 30 May 2016 12:54:27 +0000 (14:54 +0200)]
Added exception for HTTP 412/Precondition Failed

3 years agoExpose Resource class at top module level
Sybren A. Stüvel [Mon, 23 May 2016 16:12:22 +0000 (18:12 +0200)]
Expose Resource class at top module level

3 years agoAdded User.me() and Find.find_from_endpoint() class methods.
Sybren A. Stüvel [Mon, 23 May 2016 12:19:14 +0000 (14:19 +0200)]
Added User.me() and Find.find_from_endpoint() class methods.

3 years agoBumped version to 1.2.0 version-1.2.0
Sybren A. Stüvel [Wed, 18 May 2016 13:26:17 +0000 (15:26 +0200)]
Bumped version to 1.2.0

3 years agoAdded List.all_from_endpoint(url) function.
Sybren A. Stüvel [Wed, 18 May 2016 11:02:26 +0000 (13:02 +0200)]
Added List.all_from_endpoint(url) function.

This is useful when resources should be loaded from a custom Pillar
endpoint.

3 years agoAdd URL in error messages.
Sybren A. Stüvel [Wed, 18 May 2016 11:02:02 +0000 (13:02 +0200)]
Add URL in error messages.

3 years agoRemoved File.thumbnail_file in favour of File.thumbnail
Sybren A. Stüvel [Fri, 13 May 2016 08:51:26 +0000 (10:51 +0200)]
Removed File.thumbnail_file in favour of File.thumbnail

3 years agoBumped version to 1.1.2 version-1.1.2
Sybren A. Stüvel [Tue, 10 May 2016 13:03:28 +0000 (15:03 +0200)]
Bumped version to 1.1.2

3 years agoUpdated changelog
Sybren A. Stüvel [Tue, 10 May 2016 13:03:09 +0000 (15:03 +0200)]
Updated changelog

3 years agomade "'field' in resource" work
Sybren A. Stüvel [Tue, 10 May 2016 13:02:27 +0000 (15:02 +0200)]
made "'field' in resource" work

3 years agoFiles: Get thumbnails from variations, rather than from 'link' property
Sybren A. Stüvel [Tue, 10 May 2016 10:45:27 +0000 (12:45 +0200)]
Files: Get thumbnails from variations, rather than from 'link' property

The 'link' property might not exist, for example when a user is not a
Cloud subscriber.

3 years agoDon't include *.md files in wheel.
Sybren A. Stüvel [Mon, 9 May 2016 13:03:14 +0000 (15:03 +0200)]
Don't include *.md files in wheel.

Those are installed in /usr/lib/pillarsdk or /path/to/venv/lib/pillarsdk,
which is too far away from the Python package itself.

3 years agoBumped version to 1.1.1 version-1.1.1
Sybren A. Stüvel [Mon, 9 May 2016 12:36:25 +0000 (14:36 +0200)]
Bumped version to 1.1.1

3 years agoGracefully handle missing 'allowed_methods'
Sybren A. Stüvel [Mon, 9 May 2016 12:34:25 +0000 (14:34 +0200)]
Gracefully handle missing 'allowed_methods'

3 years agoBumped version to 1.1.0 version-1.1.0
Sybren A. Stüvel [Mon, 9 May 2016 10:19:58 +0000 (12:19 +0200)]
Bumped version to 1.1.0