# HG changeset patch # User Ludovic Chabant # Date 1408257026 25200 # Node ID 8f7ba2c95025944eb171658cde676ba0006ffb39 # Parent ff07f6d2345070c17973a9a4202d6037b5207134 Add packaging and related files. diff -r ff07f6d23450 -r 8f7ba2c95025 .hgignore --- a/.hgignore Sat Aug 16 15:16:31 2014 -0700 +++ b/.hgignore Sat Aug 16 23:30:26 2014 -0700 @@ -3,4 +3,7 @@ venv tags build/messages/_cache +dist +piecrust.egg-info +piecrust/__version__.py diff -r ff07f6d23450 -r 8f7ba2c95025 CHANGELOG.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CHANGELOG.rst Sat Aug 16 23:30:26 2014 -0700 @@ -0,0 +1,24 @@ + +CHANGELOG +========= + +This is the changelog for PieCrust. + +The first section deals with the latest changes in the development branch +(``default`` in Mercurial, ``master`` in Git). + +The second section deals with changes in the stable branch (``stable`` in +Mercurial, ``git-stable`` in Git), but those changes are also included in the +development branch (the development branch is ahead of the stable branch). + + +Fresh changes +------------- + +*None... this stuff is still being prepared...* + +Frozen changes +-------------- + +*None... this stuff is still being prepared...* + diff -r ff07f6d23450 -r 8f7ba2c95025 LICENSE.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LICENSE.rst Sat Aug 16 23:30:26 2014 -0700 @@ -0,0 +1,13 @@ +Copyright 2011 Ludovic Chabant + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff -r ff07f6d23450 -r 8f7ba2c95025 MANIFEST.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MANIFEST.in Sat Aug 16 23:30:26 2014 -0700 @@ -0,0 +1,12 @@ +include README.md +include CHANGELOG.md +include LICENSE.md +recursive-include piecrust *.py +recursive-include tests *.py +#global-exclude .DS_Store +#global-exclude Thumbs.db +#global-exclude Desktop.ini +#global-exclude *.swp +#global-exclude *~ +#global-exclude *.bak + diff -r ff07f6d23450 -r 8f7ba2c95025 README.md --- a/README.md Sat Aug 16 15:16:31 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -# PieCrust - -## Basic Configuration - -PieCrust comes with a simple way to work with the 90% case: a personal website with a blog. You don't have anything to define, but you can customize some aspects of that default setup. From most likely to less likely: - -* changing the URL format of posts -* changing the URL format of tags/categories -* defining new taxonomies (by default PieCrust comes with tags and categories) -* adding secondary blogs - -## Advanced Configuration - -PieCrust defines content using 3 concepts: *sources*, *taxonomies*, and *routes*. - -### Sources - -Sources define where your content is on disk, and how it's organized. By default, a source will use the `simple` scanner, but you can use other scanners that can can look for files differently, or can lift metadata information from the file names. For example, the `ordered` scanner will return the page files in the order defined by their file name prefix, and the `posts` collection of scanners will associate a date to each page based on their file name. - - sources: - posts: - type: posts/flat - recipes - reviews: - type: ordered - -### Taxonomies - -Taxonomies are used by PieCrust to generate listings of pages based on the metadata they have. For instance, you usually want pages listing posts for each existing tag. - - taxonomies: - tags: - multiple: true - category - course - ingredients: - multiple: true - -### Routes - -Routes define the shape of the URLs used to access your content. URLs for the built-in `pages` source cannot be changed, but you can specify URL routes for all custom sources and taxonomies. - - routes: - /%year%/%month%/%slug%: - source: posts - /recipes/%slug%: - source: recipes - /recipes/tag/%value%: - source: recipes - taxonomy: tags - /recipes/ingredient/%value%: - source: recipes - taxonomy: ingredients - /reviews/%slug%: - source: reviews diff -r ff07f6d23450 -r 8f7ba2c95025 README.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.rst Sat Aug 16 23:30:26 2014 -0700 @@ -0,0 +1,36 @@ + +PieCrust is a static website generator and lightweight CMS that's all managed +with text files. No complex setup, databases, or administrative panels. +Simple, beautiful, and yummy. + +For more information, along with the complete documentation, visit `the +official website`_. + +.. _the official website: http://bolt80.com/piecrust/ + + +Quickstart +========== + +If you want to quickly give it a spin: + +:: + + bin/chef init mywebsite + cd mywebsite + ../bin/chef serve + +It should create a new empty site in a ``mywebsite`` folder, and then start +your default browser to show it to you. Use ``chef prepare page`` and ``chef +prepare post`` to create pages and posts, and edit those in your favorite text +editor. + +When you're happy, run ``../bin/chef bake`` to generate the final static +website, which you'll find in ``_counter``. + + +Changes +======= + +Check out the CHANGELOG file for new features, bug fixes and breaking changes. + diff -r ff07f6d23450 -r 8f7ba2c95025 requirements.txt --- a/requirements.txt Sat Aug 16 15:16:31 2014 -0700 +++ b/requirements.txt Sat Aug 16 23:30:26 2014 -0700 @@ -11,4 +11,5 @@ pytest-mock==0.2.0 python-dateutil==2.2 repoze.lru==0.6 +six==1.7.3 strict-rfc3339==0.4 diff -r ff07f6d23450 -r 8f7ba2c95025 setup.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup.py Sat Aug 16 23:30:26 2014 -0700 @@ -0,0 +1,140 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import os.path +import sys +import time +import subprocess +from setuptools import setup, find_packages +from setuptools.command.test import test + + +def read(fname): + with open(os.path.join(os.path.dirname(__file__), fname)) as fp: + return fp.read() + + +def runcmd(cmd): + with subprocess.Popen(cmd, stdout=subprocess.PIPE, + stderr=subprocess.PIPE) as p: + out, err = p.communicate() + return out, err + + +class PyTest(test): + def finalize_options(self): + super(PyTest, self).finalize_options() + self.test_args = ['tests'] + self.test_suite = True + + def run_tests(self): + import pytest + errno = pytest.main(self.test_args) + sys.exit(errno) + + +# Figure out the version. +# (this is loosely based on what Mercurial does) +version = None +try: + if os.path.isdir(os.path.join(os.path.dirname(__file__), '.hg')): + cmd = ['hg', 'log', '-r', '.', '--template', '{tags}\n'] + tags, err = runcmd(cmd) + versions = [t for t in tags.decode('utf8').split() if t[0].isdigit()] + + cmd = ['hg', 'id', '-i'] + hgid, err = runcmd(cmd) + hgid = hgid.decode('utf8').strip() + + if versions: + # Use tag found at the current revision. Add dirty flag if any. + version = versions[-1] + if hgid.endswith('+'): + version += '+' + else: + # Use latest tag. + cmd = ['hg', 'parents', '--template', '{latesttag}+{latesttagdistance}-'] + version, err = runcmd(cmd) + version = version.decode('utf8') + hgid + + if version.endswith('+'): + version += time.strftime('%Y%m%d') +except OSError: + # Mercurial isn't installed, or not in the PATH. + version = None + + +if version: + f = open("piecrust/__version__.py", "w") + f.write('# this file is autogenerated by setup.py\n') + f.write('version = "%s"\n' % version) + f.close() + + +try: + from piecrust import __version__ + version = __version__.version +except ImportError: + version = 'unknown' + + +setup(name="piecrust", + version=version, + description="A powerful static website generator and lightweight CMS.", + long_description=read('README.rst') + '\n\n' + read('CHANGELOG.rst'), + author="Ludovic Chabant", + author_email="ludovic@chabant.com", + license="Apache License 2.0", + url="http://github.com/ludovicchabant/piecrust2", + keywords=' '.join([ + 'python', + 'website', + 'generator', + 'blog', + 'portfolio', + 'gallery', + 'cms' + ]), + packages=find_packages(), + include_package_data=True, + zip_safe=False, + install_requires=[ + 'Jinja2==2.7.3', + 'Markdown==2.4.1', + 'MarkupSafe==0.23', + 'PyYAML==3.11', + 'Pygments==1.6', + 'Werkzeug==0.9.6', + 'colorama==0.3.1', + 'mock==1.0.1', + 'py==1.4.23', + 'python-dateutil==2.2', + 'repoze.lru==0.6', + 'strict-rfc3339==0.4' + ], + tests_require=[ + 'pytest==2.6.1', + 'pytest-mock==0.2.0' + ], + cmdclass={ + 'test': PyTest + }, + classifiers=[ + 'Development Status :: 3 - Alpha', + 'License :: OSI Approved :: Apache Software License', + 'Environment :: Console', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Natural Language :: English', + 'Operating System :: MacOS :: MacOS X', + 'Operating System :: POSIX :: Linux', + 'Operating System :: Microsoft :: Windows', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3' + ], + entry_points={'console_scripts': [ + 'chef = piecrust.main:main', + ]} + ) +