58 Commits

Author SHA1 Message Date
5c7f37a100 Lowered dependency versions to satisfy Eve 2017-12-07 13:02:23 +01:00
fc25ca9c03 Replaced Bugsnag with Sentry - requires config changes!
Note that pillar/bugsnag_extra.py still exists; I'm keeping it around for
a while until we know what info we miss in Sentry, can port it, and then
remove/refactor it.
2017-12-07 12:58:21 +01:00
6c4dd8ae02 Fix T53339: Downgraded Werkzeug 0.12.2 → 0.11.15 2017-12-07 12:44:05 +01:00
d66bfe6166 Upgraded dependencies to fix problem with Flask-Script
- Flask-Script 2.0.5 → 2.0.6

Along with this came:

- Flask      0.12    → 0.12.2
- Werkzeug   0.11.15 → 0.12.2
- MarkupSafe 0.23    → 1.0
2017-11-03 11:39:53 +01:00
3263f0a551 Upgraded bugsnag 2.3.1 → 3.1.1
I hope this fixes this error; I no longer see it locally:

Traceback (most recent call last):
  File "/data/git/blender-cloud/runserver.wsgi", line 16, in <module>
    application = PillarServer(my_path)
  File "/data/git/pillar/pillar/__init__.py", line 96, in __init__
    self._config_bugsnag()
  File "/data/git/pillar/pillar/__init__.py", line 191, in _config_bugsnag
    handle_exceptions(self)
  File "/opt/python/lib/python3.6/site-packages/bugsnag/flask/__init__.py", line 27, in handle_exceptions
    got_request_exception.connect(__log_exception, app)
  File "/opt/python/lib/python3.6/site-packages/blinker/base.py", line 130, in connect
    sender_ref = reference(sender, self._cleanup_sender)
  File "/opt/python/lib/python3.6/site-packages/blinker/_utilities.py", line 134, in reference
    weak = callable_reference(object, callback)
  File "/opt/python/lib/python3.6/site-packages/blinker/_utilities.py", line 145, in callable_reference
    return BoundMethodWeakref(target=object, on_delete=callback)
  File "/opt/python/lib/python3.6/site-packages/blinker/_saferef.py", line 135, in __new__
    key = cls.calculate_key(target)
  File "/opt/python/lib/python3.6/site-packages/blinker/_saferef.py", line 196, in calculate_key
    return (id(get_self(target)), id(get_func(target)))
  File "/opt/python/lib/python3.6/site-packages/events/events.py", line 41, in __getattr__
    (self.__class__.__name__, name))
AttributeError: type object 'PillarServer' has no attribute '__self__'
2017-09-13 16:03:38 +02:00
Dalai Felinto
303a33c3bf Internationalization: Backend support to localization based on user browser
User experience
===============
For users it means we can provide localized web-sites to enrich their
overall experiences.

Although for the Blender Cloud this doesn't make much sense (since the
content is in English), Flamenco and Attract can really benefit from
this.

New configuration settings
==========================
There are two new parameters in config.py:

* DEFAULT_LOCALE='en_US'
* SUPPORT_ENGLISH=True

They are both properly documented in the `config.py` file.

Technicall details
==================
We are using the 'Accept-Languages' header to match the
available translations with the user supported languages.

If an extension has a `translations` folder, it's used for translations.
However the main application (e.g., Blender Cloud) is the one that
determines the supported languages based on its `languages` folder.

How to mark strings for translation
===================================
See the documentation in README.md.

But as an example, 404.pug and pillar/__init__.py::handle_sdk_resource_invalid
have marked up strings that will be extracted once you install pillar,
or run any of the translations commangs.

Remember to **gulp** after you update the template files.

How to setup translations
=========================
You will need to create translation for the main project, and for each
extension that you want to see translated. I added a new entry-point to
the installation of Pillar.

So all you need is to use the `translations`
script to initialize, update and compile your translations.

Pending tasks
=============
Aside from marking more strings for extraction and start the translation
effort it would be interesting to replace the pretty_date routine with
momentjs.

Acknowledgement
===============
Many thanks for Sybren Stüvel for the suggestions and throughout code
review. Thanks also to Francesco Siddi for the original documentation
and suggesting me to tackle this. And Kudos for Pablo Vazquez for the
motivational support and for the upcoming "strings mark up" task force!

The core of the implementation is based on Miguel Grinberg i18n chapter
of his great 'The Mega Flask Tutorial'.

Reviewers: sybren

Differential Revision: https://developer.blender.org/D2826
2017-09-09 00:26:18 +02:00
Dalai Felinto
d5a55f71a7 Fix Flask and Eve dependency issue
Eve expects 'flask>=0.10.1,<=0.12' so we can't use flask==0.12.2 in
pillar for now.

This needs to be fixed upstream (eve), but for now `python setup.py
install`.
2017-09-06 17:51:21 +02:00
2db0ee11db Fixed case for packages.
'pip freeze -r requirements.txt' otherwise complains about this.
2017-09-05 13:38:04 +02:00
146bf97432 Removed doubly-listed CommonMark package 2017-09-05 13:37:43 +02:00
fc5177d58b Removed pycrypto package; it's not used. 2017-09-05 13:35:30 +02:00
6b3e523036 Remove Flask-OAuthlib and oauth_blender_id from Pillar
We switch completely to a rauth-based approach, allowing multiple providers for authentication.
2017-08-25 10:53:22 +02:00
05f6fb6016 Upgraded Pillow 2.8.1 → 4.1.1
Version 4.0.0 was actually the first one to officially support Python 3.6,
so we've been lucky so far that it worked at all ;-)
2017-06-15 16:53:06 +02:00
ed4ee5228a Added Celery for background tasks.
The implementation is still rather simple, using hard-coded configuration
values. This will change in subsequent commits.

The worker can be started with "manage.py operations worker". Celery
Worker CLI options can be passed after a double dash, like this:

    ./manage.py operations worker -- -C -E
2017-06-02 10:44:37 +02:00
59a95450e5 Updated Eve, Flask, and Werkzeug. Adjusted code to make Pillar work again.
Eve     : 0.6.3   → 0.7.3
Flask   : 0.10.1  → 0.12.2
Werkzeug: 0.11.10 → 0.11.15

Also updated some secondary requirements.
2017-05-18 15:46:02 +02:00
1ad3e7910c Upgrade algoliasearch 2017-04-11 12:08:57 +02:00
49500570d4 Added missing redis requirement 2017-03-22 15:49:51 +01:00
3d1c8625a3 Remove redundant requirement
It is already defined in requirements.txt in pillar-python-sdk.
2017-03-22 15:49:51 +01:00
41600f208e Remove Linux venv specific dependencies
Was giving install error on macOS.
2017-03-22 15:49:51 +01:00
ef6e76f153 Upgraded development requirements to speed up code coverage recording
Removed requests from requirements.txt file, because it's already a req
of pillar-python-sdk.
2017-03-22 15:49:51 +01:00
dcdcd99393 Python 3.6 compatibility: random bits & bcrypt
Switched from Sybren's RSA library to the new stdlib module 'secrets' to
generate secret tokens. This also means that the rsa library was demoted
to secondary requirement.
2017-03-22 15:49:51 +01:00
16b2b119fd Referring to Pillar Python SDK requirements
This forces us to remove common requirements from Pillar's requirements.txt
file (which is a good thing).
2017-03-22 15:49:51 +01:00
c2c19bd6f3 Removed development requirements and unused secondary requirements. 2017-03-22 15:49:51 +01:00
1266d4b5d9 Made requirements.txt py36-compatible
Some packages had to be removed; they are deployment-specific anyway,
and may not even be needed any more.

I've also added some secondary requirements that weren't specified yet.
The next steps will be to split into runtime and development requirements.
2017-03-22 15:49:51 +01:00
Dalai Felinto
b04ed3f5b6 Fix problem pip install failing
Repeated elements here makes it fails (at least in WSL - Windows Subsystem Linux)
2016-11-21 23:03:52 +01:00
865259d40e pretty_date('some string') now tries to parse the string as datetime.
dateutil.parser.parse('some string') is used for this.
2016-11-08 13:38:36 +01:00
4c6a51c501 Fixed some package version conflicts between Pillar and the SDK. 2016-11-07 10:56:31 +01:00
8352fafd21 Replaced markdown with commonmark module 2016-10-20 13:05:43 +02:00
ea2be0f13d Major revision of comment system.
- Comments are stored in HTML as well as Markdown, so that conversion
  only happens when saving (rather than when viewing).
- Added 'markdown' Jinja filter for easy development. This is quite
  a heavy filter, so it shouldn't be used (much) in production.
- Added CLI command to update schemas on existing node types.
2016-10-19 16:57:17 +02:00
d7fe196af0 Some dependency cleanups. 2016-09-29 10:01:15 +02:00
407aefb9ad Added CLI command for moving top-level nodes between projects.
Also introduces a slightly nicer way to get the database interface, and
an object-oriented way to allow dependency injection.
2016-09-27 12:57:57 +02:00
54bc0e87ce Updated test requirements 2016-08-31 11:28:38 +02:00
22d758b608 Typo in requirements.txt 2016-07-13 09:36:42 +02:00
3f3e9ac7db Nodes can now be shared with /nodes/<node_id>/share endpoint.
A POST will create a short link (if it doesn't exist already), whereas
a GET will return the short link for the node.

The endpoint will return a dict like:

{'short_code': 'XXXXXX',
 'short_link': 'https://blender.cloud/r/XXXXX',
 'theatre_link': 'https://blender.cloud/r/XXXXX?t'}
2016-07-07 15:17:56 +02:00
17902eb730 Bumped Werkzeug to 0.11.10, this fixes our memory issue. 2016-05-24 11:38:09 +02:00
2b29ec8ed6 Bumped version of Werkzeug to solve the memory error with large uploads. 2016-05-24 10:49:36 +02:00
6c7ad6f6f0 Marked Flask as primary requirement. 2016-05-02 15:38:02 +02:00
c45ac153e2 Added bcrypt to requirements.txt 2016-04-26 12:38:44 +02:00
974f135e63 Measure unit test coverage.
Coverage is reported with py.test, and also "Run unit tests in ... with
coverage" is now supported in PyCharm.
2016-04-25 16:43:09 +02:00
5116b74d1d Updated Eve to 0.6.3
This also updates Cerberus to 0.9.2 and simplejson to 3.8.2.

I've also changed the way we get to the application object, by replacing
   from application import app
with
   from flask import current_app
2016-04-25 16:14:05 +02:00
66eeb25529 Unify tokens and subclient tokens
SCST tokens are now stored in the 'tokens' table.
This unifies old token handling and new subclient-specific tokens.
Also ensures the BlenderID expiry of the token is taken into account.

Removes use of httpretty, in favour of responses.
2016-04-13 15:33:54 +02:00
0f6eeef32b Upgraded to gcloud-0.12.0
This removes the need to use a Git checkout, and allows us to use an
actual version number again, with a package from PyPi.
2016-04-13 10:50:49 +02:00
aeee165ad8 subclient tokens: bugfix & return proper data.
Also introduces responses, as an alternative to httpretty (it works
better).
2016-04-12 15:24:50 +02:00
a33e4421a8 Introducing Project creation
Authorised users can now create projects. The before and after insert
projects hooks take care of stripping unwanted urls and attaching
default node_type and permissions, as well as initialising a storage
bucket per project. We are temporarily switching to the development
version of the gcloud library, since it allows the creation of EU-based
buckets.
2016-03-24 15:16:37 +01:00
f90f25d373 Upgraded gcloud package to 0.11.0 2016-03-14 14:51:46 +01:00
ef0441b4c7 Updated requirements.
Removed some 2nd degree requirements, and updated rsa module to latest
versions (it's backward compatible with the previous version).
2016-03-04 12:13:09 +01:00
6a5f4b2661 Removed some 2nd degree requirements.
This makes it possible to install requirements for pillar and pillar-web
in the same virtualenv.
2016-03-02 10:21:37 +01:00
ea7e5a0955 Updated requirements for algoliashearch library 2016-02-25 15:01:32 +01:00
3308751ed4 Introducing external video encoding
It is now possible to specify an encoding backend (at the moment only
zencoder) to take care of video variations encoding. Files transfer
happens directly on CGS (although any storage backend can be
supported). New requirements is the Zencoder Python library.
2016-02-22 16:48:53 +01:00
c7b6e798c0 Introducing Algolia search for users
With the new dependency, algoliasearch, we can push and store on the
Algolia service a limited set of properties from the Users collection.
2016-02-10 16:13:07 +01:00
322530761e Added bugsnag 2015-10-20 23:52:18 +02:00