Git Product home page Git Product logo

grow / grow Goto Github PK

View Code? Open in Web Editor NEW
396.0 26.0 51.0 11.39 MB

A declarative website generator designed for high-quality websites, with a focus on easy maintenance and localization.

Home Page: https://grow.dev

License: MIT License

HTML 1.06% CSS 0.03% JavaScript 0.46% Dockerfile 0.20% Makefile 0.26% Python 97.20% Shell 0.16% Sass 0.62%
static-site-generator internationalization cli quality-websites jinja2 python3 localization yaml

grow's Introduction

Grow.dev

PyPi GitHub Actions Downloads Code Coverage

Grow is a declarative tool for rapidly building, launching, and maintaining high-quality static HTML.

  • Easy installation
  • Jinja template engine
  • Content managed in YAML and JSON files
  • Data-binding between content and templates
  • Configuration-based site architecture
  • Easy URL changes
  • Flexible internationalization and translation
  • Integration with external CMSes
  • Integration with Google Sheets
  • Fast builds

Quick start

One time only: install Pipenv and libyaml.

# On Mac with Homebrew (https://brew.sh/).
brew install pipenv libyaml

# On Ubuntu.
sudo apt install -y pipenv libyaml-dev

# On other distributions.
sudo apt install python-pip; pip install pipenv

Next: install and run Grow using a starter.

git clone https://github.com/grow/starter
cd starter
pipenv install
pipenv run grow install
pipenv run grow run

Documentation

Visit https://grow.dev to read the documentation.

grow's People

Contributors

amacdonald-google avatar denmojo avatar dependabot[bot] avatar elee-lfl avatar fotinakis avatar github-actions[bot] avatar jeremydw avatar kezlya avatar lgiordani avatar matthiasrohmer avatar rspier avatar statusz avatar stevenle avatar streeter avatar stucox avatar willthomson avatar zoramite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grow's Issues

Reorganize/remove dead code.

Now that the project has made an "experimental" release, it's time to remove dead code and organize a few things to make it easier for contributors.

Improve BaseDeployment class

Move some of the business logic from existing subclasses of BaseDeployment to the parent class. This should make it easier to add new deployments by simply implementing a few methods which are specific to the deployments.

Methods are:

  • write_file
  • read_file
  • delete_file
  • prelaunch
  • postlaunch
  • init (to accept custom arguments, per deployment)

Add support for Google Spreadsheets preprocessor

Sample syntax:

preprocessors:
  - kind: google_spreadsheets
    path: /data/file.csv
    id: 1winHap7dPK1dWu46DqPK1-bwkKJQv6ljDMrDz6HepGE
    gid: 12345

Exports the Google spreadsheet by id and gid to pod path /data/file.csv

Implement better way to increment version and release

Right now the version number is stored in two places: install.py and grow/VERSION. We need to consolidate this to one place.

In addition to creating one canonical place to store the version, the update checker (in grow/common/sdk_utils.py) should consult the latest released version of Grow, not the VERSION file that's checked into the repo, in order to determine what the latest SDK version is.

Lastly, we need an automated way to upload a release to GitHub. Probably this means updating upload_release.sh to use the GitHub API for releases. Right now upload_release.sh simply uploads the PyPi release.

Closure Compiler preprocessor needs directories to exist before writing generated file

Traceback:

$ grow run
Traceback (most recent call last):
  File "<string>", line 37, in <module>
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/click.core", line 610, in __call__
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/click.core", line 590, in main
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/click.core", line 936, in invoke
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/click.core", line 782, in invoke
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/click.core", line 416, in invoke
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/grow.commands.run", line 30, in run
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/grow.server.manager", line 49, in start
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/grow.pods.preprocessors.file_watchers", line 123, in create_dev_server_observers
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/grow.pods.preprocessors.file_watchers", line 78, in schedule_preprocessors
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/grow.pods.preprocessors.file_watchers", line 87, in _schedule_preprocessor
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/watchdog.observers.fsevents", line 172, in schedule
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/watchdog.observers.api", line 329, in schedule
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/watchdog.observers.fsevents", line 73, in __init__
  File "/Users/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/watchdog.utils.dirsnapshot", line 246, in __init__
OSError: [Errno 2] No such file or directory: '/Users/jeremydw/repo/bower_components/.tmp'
jeremydw@jeremydw-macbookair:~/repo/$ mkdir -p 

SCP deployment authentication error

When trying to authenticate with ssh-agent keys, I get an authentication error. It is a non-specific error and I believe it to be a mismatch between dev username and target username:

~  whoami
dennis
~  ssh-add -l
2048 20:5c:dd:a9:0f:df:aa:45:d1:93:a0:bc:1b:43:ac:df /Users/dennis/.ssh/id_rsa (RSA)
~  grow deploy web1 mojado.com
Deploying to: mojado.com:/home/dmojado/www/

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
Connected (version 2.0, client OpenSSH_6.0p1)
Authentication (publickey) failed.
Traceback (most recent call last):
  File "<string>", line 27, in <module>
  File "/Users/jeremydw/git/macgrow/pygrow/build/grow/out00-PYZ.pyz/google.apputils.appcommands", line 796, in Run
  File "/Users/jeremydw/git/macgrow/pygrow/build/grow/out00-PYZ.pyz/google.apputils.app", line 238, in run
  File "/Users/jeremydw/git/macgrow/pygrow/build/grow/out00-PYZ.pyz/google.apputils.app", line 267, in _actual_start
  File "/Users/jeremydw/git/macgrow/pygrow/build/grow/out00-PYZ.pyz/google.apputils.appcommands", line 793, in InterceptReallyStart
  File "/Users/jeremydw/git/macgrow/pygrow/build/grow/out00-PYZ.pyz/google.apputils.app", line 220, in really_start
  File "/Users/jeremydw/git/macgrow/pygrow/build/grow/out00-PYZ.pyz/google.apputils.appcommands", line 778, in _CommandsStart
  File "/Users/jeremydw/git/macgrow/pygrow/build/grow/out00-PYZ.pyz/google.apputils.appcommands", line 284, in CommandRun
  File "/Users/jeremydw/git/macgrow/pygrow/build/grow/out00-PYZ.pyz/grow.commands", line 96, in Run
  File "/Users/jeremydw/git/macgrow/pygrow/build/grow/out00-PYZ.pyz/grow.deployments.base", line 130, in deploy
  File "/Users/jeremydw/git/macgrow/pygrow/build/grow/out00-PYZ.pyz/grow.deployments.scp", line 24, in prelaunch
  File "/Users/jeremydw/git/macgrow/pygrow/build/grow/out00-PYZ.pyz/paramiko.client", line 273, in connect
  File "/Users/jeremydw/git/macgrow/pygrow/build/grow/out00-PYZ.pyz/paramiko.client", line 456, in _auth
paramiko.ssh_exception.AuthenticationException: Authentication failed.

I tried to debug as it is happening in scp.py:

python
Python 2.7.5 (default, Mar  9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko, os
>>> paramiko.common.logging.basicConfig(level=paramiko.common.DEBUG)
>>> ssh = paramiko.SSHClient()
>>> ssh.load_system_host_keys()
>>> ssh.connect("www.mojado.com", port=22)
DEBUG:paramiko.transport:starting thread (client mode): 0xa592610L
INFO:paramiko.transport:Connected (version 2.0, client OpenSSH_6.0p1)
DEBUG:paramiko.transport:kex algos:['ecdh-sha2-nistp256', 'ecdh-sha2-nistp384', 'ecdh-sha2-nistp521', 'diffie-hellman-group-exchange-sha256', 'diffie-hellman-group-exchange-sha1', 'diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1'] server key:['ssh-rsa', 'ssh-dss', 'ecdsa-sha2-nistp256'] client encrypt:['aes128-ctr', 'aes192-ctr', 'aes256-ctr', 'arcfour256', 'arcfour128', 'aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'aes192-cbc', 'aes256-cbc', 'arcfour', '[email protected]'] server encrypt:['aes128-ctr', 'aes192-ctr', 'aes256-ctr', 'arcfour256', 'arcfour128', 'aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'aes192-cbc', 'aes256-cbc', 'arcfour', '[email protected]'] client mac:['hmac-md5', 'hmac-sha1', '[email protected]', 'hmac-sha2-256', 'hmac-sha2-256-96', 'hmac-sha2-512', 'hmac-sha2-512-96', 'hmac-ripemd160', '[email protected]', 'hmac-sha1-96', 'hmac-md5-96'] server mac:['hmac-md5', 'hmac-sha1', '[email protected]', 'hmac-sha2-256', 'hmac-sha2-256-96', 'hmac-sha2-512', 'hmac-sha2-512-96', 'hmac-ripemd160', '[email protected]', 'hmac-sha1-96', 'hmac-md5-96'] client compress:['none', '[email protected]'] server compress:['none', '[email protected]'] client lang:[''] server lang:[''] kex follows?False
DEBUG:paramiko.transport:Ciphers agreed: local=aes128-ctr, remote=aes128-ctr
DEBUG:paramiko.transport:using kex diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local aes128-ctr, remote aes128-ctr; mac: local hmac-sha1, remote hmac-sha1; compression: local none, remote none
DEBUG:paramiko.transport:Switch to new keys ...
DEBUG:paramiko.transport:Trying SSH agent key 205cdda90fdfaa45da9fa0bd1843acdf
DEBUG:paramiko.transport:userauth is OK
INFO:paramiko.transport:Authentication (publickey) failed.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.8-intel/egg/paramiko/client.py", line 337, in connect
  File "build/bdist.macosx-10.8-intel/egg/paramiko/client.py", line 528, in _auth
paramiko.AuthenticationException: Authentication failed.
>>> DEBUG:paramiko.transport:EOF in transport thread

When I have ssh key in ssh-agent and test with parameter "username", e.g.

>>> ssh.connect("www.mojado.com", username="dmojado" port=22)

the connection seems to work.

I propose we add an optional username parameter to destination: scp in podspec.yaml to allow for discrepancies between dev username and production server login.

How to define partial content collections?

The documentation says:

Content documents can be associated with URLs and with views (so they represent pages in your site), or not. Content documents without URLs are simply used internally, and can be referenced by other content documents.

and

If path is omitted, content in this collection will not be generated into pages. If path is specified, view is a required field.

Which I interpret to mean, if I do not define paths, by having an empty _blueprint.yaml file in my collection directory, then the filename.html HTML snippet content in it (which also has no YAML front matter) will not have paths generated for it, but will be able to be referenced by other content by specifying a document path as a variable and referencing it in my template like this:

{% set fbpixel = g.doc(doc.fbpixel) %}
{{fbpixel.html|safe}}

However, this does not appear to be the case. An empty _blueprint.yaml, with no path or view specified, still causes the documents to try to be processed in collectionz.py list_documents() process(). Providing YAML front matter to define $hidden: true also does not help, as it continues onto the locale handling code.

It seems the minimum amount of YAML for this to work as expected is a _blueprint.yaml with only:

path: 

And also the same in the front matter for my HTML snippet. Only having one or the other does not seem to work: only in the front matter and there's a locale issue; only in the blueprint and there's a path naming issue.

(Also, when debugging this, the routing table seems to not clear itself properly; I kept having to kill and re-run grow run to triage this.)

So:

  1. Am I including one piece of content in another properly?
  2. Is this the intended behavior of a partial piece of content without a rendered URL or path?

(I expected an empty _blueprint.yaml and needing no front matter to work.)

grow binary tracebacks show build system path

Tracebacks displayed by the grow binary currently show the build system's path. Example below. The issue actually has to do with PyInstaller and the code freezing process. There is apparently a workaround that we can look into (see links below), but it seems no one is actively working on this issue on the PyInstaller side.

stevenle@sl-ubuntu:~/src/stevenle.github.io$ grow run _grow

Traceback (most recent call last):
  File "<string>", line 34, in <module>
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.appcommands", line 796, in Run
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.app", line 238, in run
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.app", line 267, in _actual_start
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.appcommands", line 793, in InterceptReallyStart
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.app", line 220, in really_start
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.appcommands", line 778, in _CommandsStart
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.appcommands", line 284, in CommandRun
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/grow.commands", line 186, in Run
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/grow.server.manager", line 53, in start
AttributeError: 'module' object has no attribute 'create_dev_server_observer'

why it says "/root/bin/grow: cannot execute binary file"?

hi.
git clone https://github.com/grow/pygrow grow
cd grow

as3:/grow# ls
AUTHORS grow LICENSE run_service_tests.sh
bin grow.spec MANIFEST.in run_tests.py
build_release.sh install README.md setup.py
description.txt install.py requirements.txt upload_release.sh
as3:
/grow# pip install -r requirements.txt
as3:/grow#
as3:
/grow# python install.py install
Welcome to the installer for Grow SDK v0.0.30
==> This script will install: /root/bin/grow
==> An alias for "grow" will be created in: /root/.bash_profile
Continue? [y/N]: y
Downloading from https://github.com/grow/pygrow/releases/download/0.0.30/Grow-SDK-

Linux-0.0.30.zip
.................. done!
[✓] Installed Grow SDK to: /root/bin/grow
[✓] Created "grow" alias in: /root/.bash_profile
All done! Now type "grow" and press enter to use the Grow SDK.
as3:/grow# grow
-bash: /root/bin/grow: cannot execute binary file
as3:
/grow# /root/bin/grow
-bash: /root/bin/grow: cannot execute binary file
as3:~/grow#

how to fix it?
tks

Ignore files when deploy

grow deploy currently deploys .DS_Store files. Would be nice to have a way to ignore files, as well as adding some default files. Similar to .gitignore.

Pre-processors design and implementation

Pre-processors would enable integration with the following kinds of utilities:

  • JS minifcation/compilation/etc.
  • CSS minification/compilation/inlining/etc.
  • HTML Tidy

Custom preprocessors / plugins

Would be great to be able to write custom preprocessor in python, or jinja extensions, without having to fork the repo. If there was some way to tell grow to add plugins dynamically, would make it much more customizable.

Relative links in build and deploy files

This may not be an error - I could just be missing something. When I run growsdk or codelab, all the links within the pages and sub-pages are fine. It appears that somehow within the server, all static items are always available at "/static/" regardless of path. When I generate the sites,however, with either build or deploy, the directory structure is not reflected in the links.

In codelab, for example, the static directory is referenced throughout in this way:

href="/static/css/main.min.css"

But for the generated static site, what's really needed is the following.

At the root:

href="static/css/main.min.css"

From the pages:

href="../static/css/main.min.css"

And from the posts:

href="../../static/css/main.min.css"

Is this something that's supposed to be addressed through configuration? Or from manipulating the url from within the view?

A related problem seems to crop up if you set the root path. If you do so, you have to (logically) change where the static directory is served from in order to cause the build to place the static directory within the new root path directory. (404 page winds up outside, too, FWIW.) But changing where the static directory is served from does not change the generated links to:

href="/newrootpath/static/css/main.min.css"

They remain:

href="/static/css/main.min.css"

Again, this could be my ignorance. I'm still trying to figure it all out. But it is surprising in that the build & deploy results do not match those of the results of the built-in server.

Add support for Sass flags

Discussion at https://groups.google.com/forum/#!topic/growsdk/Rz2GtpCzGYw

We need to add support for configuring a few of Sass's options. We should allow the user to configure all options that it makes sense to allow them to configure, but prohibit them from configuring things that we should have an opinion about (such as some caching stuff, filesystem-related stuff, some of the system-related stuff, etc.).

For Sass, Grow SDK currently uses a Python binding of libsass (https://github.com/hcatlin/libsass), libsass-python (http://dahlia.kr/libsass-python/).

Install script feedback

  • install.growsdk.org should 302 to a URL that ends in .sh. That way, if I save the file locally instead of piping it to bash, it'll show as ".sh" instead of "index.html". (Alternatively, setting a Content-Disposition header might work but I haven't tested.)
  • Install location should be configurable. For example, I prefer to install at /usr/local/grow.
  • On Ubuntu, adding .bash_profile ignores .profile (the default), which means the more common .bashrc is never sourced.
  • I think it's better to add $GROW/bin to $PATH than to create an alias. If you create additional binaries, it'll automatically be available if you add it to $GROW/bin.

Gulp.js integration

I've used Gulp.js on a few projects recently and find it to be an amazingly intuitive way of setting up a build workflow. Just throwing a suggestion out there to integrate it into the 'grow build' command.

Deprecate Closure Compiler preprocessor

  • Deprecate Closure Compiler preprocessor
  • Add complete examples for using Gulp, Closure Compiler, autoprefixer, etc.
  • Add documentation for best practices with Gulp + Grow
  • Add theme for a scaffold that includes a sensible gulpfile.js
  • Add documentation for using grow/growsdk Docker image

sourcecode extension leaves stray linebreak at the end

I find that the [sourcecode] extension always leaves a stray <br /> tag. The markup I see in Firebug:

<div class="code">
    <div class="highlight" ...>
        ...
    </div>
    <br>
</div>

I'm not quite sure what corner-case the line-ending substitution is intending to catch, but everything seems to look fine if I just remove it:

--- a/grow/common/markdown_extensions.py
+++ b/grow/common/markdown_extensions.py
@@ -114,7 +114,6 @@ class CodeBlockPreprocessor(preprocessors.Preprocessor):
       except ValueError:
         lexer = lexers.TextLexer()
       code = highlight(m.group(2), lexer, self.formatter)
-      code = code.replace('\n\n', '\n&nbsp;\n').replace('\n', '<br />')
       return '\n\n<div class="code">%s</div>\n\n' % code
     joined_lines = "\n".join(lines)
     joined_lines = self.pattern.sub(repl, joined_lines)

Image manipulation feature (tags and preprocessor)

This will prevent people from launching sites with images that are not optimized. Since image processing is often not implemented in pure Python, we should have a close look at file size and platform compatibility implications when adding this preprocessor.

Codelab error

I'm doing:

grow init codelab _grow
grow run _grow

And when I navigate to localhost:8080, I get error The resource could not be found..

SDK version: 0.0.31

AttributeError: 'module' object has no attribute 'create_dev_server_observer'

Traceback:

stevenle@sl-ubuntu:~/src/stevenle.github.io$ grow run _grow

  The Grow SDK is experimental. Expect backwards incompatibility until v0.1.0.
  Thank you for testing and contributing! Visit http://growsdk.org for resources.

Traceback (most recent call last):
  File "<string>", line 34, in <module>
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.appcommands", line 796, in Run
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.app", line 238, in run
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.app", line 267, in _actual_start
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.appcommands", line 793, in InterceptReallyStart
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.app", line 220, in really_start
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.appcommands", line 778, in _CommandsStart
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/google_apputils.appcommands", line 284, in CommandRun
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/grow.commands", line 186, in Run
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/grow.server.manager", line 53, in start
AttributeError: 'module' object has no attribute 'create_dev_server_observer'

Implement pod/SDK version validation

Currently, grow_version is a required field in podspec.yaml however we don't enforce this requirement. We should:

  • enforce the grow_version (and project_id) keys in podspec.yaml (see documentation),
  • implement a semantic versioning check to ensure that the pod version is compatible with the Grow SDK version.

We currently don't have any centralized location where we validate a pod and its configuration files, so perhaps this would be a good candidate to start that work. Perhaps in a new file pygrow/grow/pods/validation.py.

If the pod fails to validate when the server is started (or when attempting a build/deploy), an error should be shown to the user invoking the command informing them what the issue is and how to fix it.

`pip install grow` fails with pip 6+

Apparently sessions are a new thing in pip?

Just installed pip fresh on an OS X Yosemite system, got pip 6.0.8, did pip install grow, got:

Collecting grow
  Downloading grow-0.0.40.tar.gz (6.1MB)
    100% |################################| 6.1MB 42kB/s 
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/private/var/folders/tp/tx8xhwrs4j969bmjjs_qww200000gn/T/pip-build-kguB0D/grow/setup.py", line 21, in <module>
        install_requires=[str(ir.req) for ir in _install_requirements],
      File "/Users/vitorio/Library/Python/2.7/lib/python/site-packages/pip-6.0.8-py2.7.egg/pip/req/req_file.py", line 19, in parse_requirements
        "parse_requirements() missing 1 required keyword argument: "
    TypeError: parse_requirements() missing 1 required keyword argument: 'session'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

      File "<string>", line 20, in <module>

      File "/private/var/folders/tp/tx8xhwrs4j969bmjjs_qww200000gn/T/pip-build-kguB0D/grow/setup.py", line 21, in <module>

        install_requires=[str(ir.req) for ir in _install_requirements],

      File "/Users/vitorio/Library/Python/2.7/lib/python/site-packages/pip-6.0.8-py2.7.egg/pip/req/req_file.py", line 19, in parse_requirements

        "parse_requirements() missing 1 required keyword argument: "

    TypeError: parse_requirements() missing 1 required keyword argument: 'session'

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/tp/tx8xhwrs4j969bmjjs_qww200000gn/T/pip-build-kguB0D/grow

I think this is an example of another project with the same problem, and their fix: jmcarp/robobrowser@89027e7

Create /_grow/ admin console on the development server

Users should be able to kick off preprocessors or run commands like machine_translate through a web-based admin console. Particularly useful for Google Sheets integration to manually trigger a redownload without restarting the dev server.

machine_translate error

I'm loving the overall idea of GrowSDK and having fun exploring it. But I have run into the following glitch on Linux with 0.0.44.

When running, for example:

grow machine_translate --locale=ja ./my-codelab/

I get the following result:

[08:59:11] Updating translation template: /translations/messages.pot
[08:59:11] Extracting from: /views/index.html
[08:59:11] Extracting from: /views/base.html
[08:59:11] Extracting from: /views/posts.html
[08:59:11] Extracting from: /views/team.html
[08:59:11] Extracting from: /views/pages.html
[08:59:11] Extracting from: /views/archive.html
[08:59:11] Extracting from: /views/errors/default.html
[08:59:11] Extracting from collection: /content/pages
[08:59:11] Extracting from collection: /content/posts
[08:59:11] Extracting from podspec: /podspec.yaml
[08:59:11] Writing 33 messages to translation template.
Traceback (most recent call last):
  File "<string>", line 43, in <module>
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/click.core", line 610, in __call__
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/click.core", line 590, in main
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/click.core", line 936, in invoke
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/click.core", line 782, in invoke
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/click.core", line 416, in invoke
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/grow.commands.machine_translate", line 19, in machine_translate
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/grow.pods.catalogs.catalogs", line 192, in machine_translate
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/goslate", line 166, in _execute
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/goslate", line 363, in <lambda>
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/goslate", line 283, in _translate_single_text
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/goslate", line 166, in _execute
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/goslate", line 281, in <lambda>
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/goslate", line 206, in _basic_translate
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/goslate", line 144, in _open_url
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/urllib2", line 410, in open
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/urllib2", line 523, in http_response
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/urllib2", line 442, in error
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/urllib2", line 382, in _call_chain
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/urllib2", line 629, in http_error_302
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/urllib2", line 410, in open
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/urllib2", line 523, in http_response
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/urllib2", line 448, in error
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/urllib2", line 382, in _call_chain
  File "/home/jeremydw/git/pygrow/build/grow/out00-PYZ.pyz/urllib2", line 531, in http_error_default
urllib2.HTTPError: HTTP Error 400: Bad Request

Automatically reload server when translations are recompiled

We currently watch translations for changes and automatically recompile them, but the user still needs to manually reload the server. We need to evict the gettext cache and reload the development server (if necessary) so that recompiled translations are immediately available.

`context` is undefined using `grow machine_translate`.

Traceback:

$ grow machine_translate --locale=es .                                                                                    
[13:11:50] Updating translation template: /translations/messages.pot
[13:11:50] Extracting from: /views/base.html
[13:11:50] Extracting from: /content/pages/index.html
[13:11:50] Extracting from collection: /content/pages
Traceback (most recent call last):
  File "/usr/local/bin/grow", line 5, in <module>
    pkg_resources.run_script('grow==0.0.39', 'grow')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 492, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1350, in run_script
    execfile(script_filename, namespace, namespace)
  File "/Library/Python/2.7/site-packages/grow-0.0.39-py2.7.egg/EGG-INFO/scripts/grow", line 37, in <module>
    grow()
  File "/Library/Python/2.7/site-packages/click/core.py", line 610, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/click/core.py", line 590, in main
    rv = self.invoke(ctx)
  File "/Library/Python/2.7/site-packages/click/core.py", line 936, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Python/2.7/site-packages/click/core.py", line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Python/2.7/site-packages/click/core.py", line 416, in invoke
    return callback(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/grow-0.0.39-py2.7.egg/grow/commands/machine_translate.py", line 15, in machine_translate
    pod.catalogs.extract()
  File "/Library/Python/2.7/site-packages/grow-0.0.39-py2.7.egg/grow/pods/catalogs/catalog_holder.py", line 137, in extract
    utils.walk(doc.tagged_fields, lambda *args: callback(doc, *args))
  File "/Library/Python/2.7/site-packages/grow-0.0.39-py2.7.egg/grow/common/utils.py", line 61, in walk
    callback(item, key, node)
  File "/Library/Python/2.7/site-packages/grow-0.0.39-py2.7.egg/grow/pods/catalogs/catalog_holder.py", line 137, in <lambda>
    utils.walk(doc.tagged_fields, lambda *args: callback(doc, *args))
  File "/Library/Python/2.7/site-packages/grow-0.0.39-py2.7.egg/grow/pods/catalogs/catalog_holder.py", line 123, in callback
    _handle_field(doc.pod_path, item, key, unused_node)
  File "/Library/Python/2.7/site-packages/grow-0.0.39-py2.7.egg/grow/pods/catalogs/catalog_holder.py", line 130, in _handle_field
    item, None, [(path, 0)], auto_comments=comments, context=context)
NameError: free variable 'context' referenced before assignment in enclosing scope

LOC:
https://github.com/grow/pygrow/blob/develop/grow/pods/catalogs/catalog_holder.py#L130

Add coffescript support

Grow ideally useful for SPA. It should be good idea to add coffeescript support to grow sdk as one of built-in preprocessors (like SASS support, for example).

Auto-creation of GCS bucket on first use

When deployed for the first time, Grow SDK on App Engine needs to create a GCS bucket when using GCS for storage. Currently, it assumes the bucket already exists and dies when trying to write files to a non-existent bucket.

Add g.yaml tag.

Should be able to load YAML files into context variables. Usage is:

{% set foo = g.yaml('/data/foo.yaml') %}

Pre-launch visual preview

As part of the deployment process, we should have a way to visually preview the pages that are about to be launched. This should include the ability to see all pages, compare pages across locales, show "desktop vs. mobile", and also (eventually) compare staging to live.

Make URL changes easier by adding ability to maintain redirects/alternate URLs in collections

To make URL changes easier, add the ability for content documents and collections to specify a list of alternate URLs (paths) that redirect to the canonical URL for the content.

Example of a URL change:

#1: /content/pages/_blueprint.yaml
path: /foo/{slug}/

#2:  /content/pages/_blueprint.yaml
path: /site/foo/{slug}/
redirects:
- path: /foo/{slug}/

For a page whose slug is "bar", when (2) is deployed, requests to /foo/bar/ will be redirected to /site/foo/bar/. When site owners decide the redirects are no longer necessary, they can be easily removed from the blueprint without hunting down the origin/reason behind the URL change/redirect.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.