1
0
Fork 0
forked from github/pelican

Compare commits

...
Sign in to create a new pull request.

29 commits

Author SHA1 Message Date
Jason K. Moore
0731d061f9 Include the tests package in the source distribution
Fixes #2635
2020-08-20 11:27:49 +02:00
kernc
21c9ce1b73 Rename setting SUMMARY_END_MARKER → SUMMARY_END_SUFFIX (#2792)
Avoids clash with 'summary' plugin.

Refs: https://github.com/getpelican/pelican-plugins/pull/1284#issuecomment-660715086
2020-08-20 11:27:49 +02:00
Justin Mayer
01b08bd812 Rename branch for GitHub Pages repo quickstart 2020-08-20 11:27:49 +02:00
Justin Mayer
af1c1773bb Minor improvements to installation docs 2020-08-20 11:27:49 +02:00
Justin Mayer
d2b119387e Remove outdated references to Python 2.7 in docs 2020-08-20 11:27:49 +02:00
Justin Mayer
3d5a2b9014 Prefix Pip commands with python -m in docs
This ensures Pip commands will be executed for the current Python
interpreter and not, say, whichever Python interpreter happens to be
associated with `/usr/local/bin/pip`.
2020-08-20 11:27:49 +02:00
Justin Mayer
d473dbfdaf Use more reliable installation command in docs
Some shell environments may interpret brackets as glob patterns.
Wrapping the argument in quotation marks should help ensure correct
behavior in those environments. Refs #2786
2020-08-20 11:27:49 +02:00
John T. Wodder II
c7cb9a7587 Lowercase metadata field name when comparing with FORMATTED_FIELDS in rST reader 2020-08-20 11:27:49 +02:00
Justin Mayer
177f8a8a0c Auto-detect physical CPU cores via pytest-xdist 2020-08-20 11:27:49 +02:00
Justin Mayer
8844357d53 Upgrade pytest-xdist dev dependency to v2.0
Also, stop pinning pytest version, since older version combined with
pytest-xdist 2.0 caused CI test errors.
2020-08-20 11:27:49 +02:00
Justin Mayer
3564e6bbe7 Support Booleans in --extra-settings. Refs #2789 2020-08-20 11:27:49 +02:00
Justin Mayer
4c440e6b7d Fix error in --extra-settings feature. Refs #2789 2020-08-20 11:27:49 +02:00
shakram02
de793fa9f0 fix usage of pelican_open in docs 2020-08-20 11:27:49 +02:00
David Beitey
541dd72cc0 Remove duplicate port arguments in Makefile
The PORT variable check earlier in the Makefile sets up the `-p` argument as part of PELICANOPTS so prior to this change `-p` was duplicated on each of the serve targets.
2020-08-20 11:27:49 +02:00
Arnaud Rebillout
c6241180cc Makefile, include tags directory in rsync command
By default, the rsync option '--cvs-exclude' excludes the 'tags'
directory. For a blog, it's a bit unfortunate, as it's quite common to
have a `tags` directory in a blog, either for the tag pages or the tag
feeds.

With this commit, we force rsync to include this directory, and save a
little headache to users who wonder why their tags are present in the
output directory, but are not present on the server.
2020-08-20 11:27:49 +02:00
Justin Mayer
75ab2b219e Document -e / --extra-settings option flags 2020-08-20 11:27:49 +02:00
Justin Mayer
e545a47cdc Rename CLI flag syntax for settings override feature 2020-08-20 11:27:49 +02:00
Peter Sabaini
923a29aaad Override settings from the command line
Add a --setting-overrides KEY=VAL command line option to override
default settings or those defined in settings files. This adds
flexibility in running Pelican and helps reduce sprawl of settings
files. Cast int and str setting overrides to their respective types.
Support other setting types by treating them as JSON. Fall back to JSON
when an override typecast errors. This should make it possible to set
int values to None, resp. to JSON 'none'
2020-08-20 11:27:49 +02:00
Justin Mayer
8a3cff38b3 Update PyPI classifiers; add funding & tracker links 2020-08-20 11:27:49 +02:00
Justin Mayer
5c93a86eea Adjust isort task: v5.2+ is now recursive by default 2020-08-20 11:27:49 +02:00
Justin Mayer
f739598289 Remove self-referential Template Pages link in docs 2020-08-20 11:27:49 +02:00
Justin Mayer
4ca6506909 Update & re-order dependencies in pyproject 2020-08-20 11:27:25 +02:00
Justin Mayer
6a40e24d85 Test new Pip 20.2 dependency resolver in GitHub CI 2020-07-29 07:45:26 +02:00
Justin Mayer
b10bb2f472 Print Pip version during test install on Windows 2020-07-29 07:14:25 +02:00
Justin Mayer
2d9f1a4719 Test package uninstallation on Windows 2020-07-29 07:04:45 +02:00
Justin Mayer
30d782fd84 Test package installation on Windows in CI 2020-07-29 06:45:34 +02:00
Justin Mayer
9c3bb6bf91 Update & re-order dependencies in pyproject 2020-07-29 06:45:34 +02:00
Justin Mayer
7b67829872 Switch build system from setuptools to Poetry 2020-07-29 06:45:34 +02:00
Justin Mayer
7986c17611 Add missing entry points to pyproject file 2020-07-29 06:45:34 +02:00
25 changed files with 245 additions and 104 deletions

View file

@ -66,7 +66,9 @@ jobs:
with:
pandoc-version: "2.9.2"
- name: Install tox
run: python -m pip install -U pip tox
run: |
python -m pip install -U pip
python -m pip install --use-feature=2020-resolver -U tox
- name: Info
run: |
echo "===== PYTHON ====="
@ -96,7 +98,9 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- name: Install tox
run: python -m pip install -U pip tox
run: |
python -m pip install -U pip
python -m pip install --use-feature=2020-resolver -U tox
- name: Check
run: tox -e flake8
@ -120,11 +124,59 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- name: Install tox
run: python -m pip install -U pip tox
run: |
python -m pip install -U pip
python -m pip install --use-feature=2020-resolver -U tox
- name: Check
run: tox -e docs
install_sdist:
name: Install sdist on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1.1.1
with:
python-version: 3.6
- name: Test sdist installation on Windows
run: |
python -m pip install -U pip
python -m pip install --use-feature=2020-resolver -U poetry
poetry build
echo "Pip version:"
python -m pip --version
python -m pip install --use-feature=2020-resolver ${env:GITHUB_WORKSPACE}\dist\pelican-4.2.0.tar.gz
echo "Pelican version:"
pelican --version
python -m pip uninstall -y pelican
install_wheel:
name: Install wheel on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1.1.1
with:
python-version: 3.6
- name: Test wheel installation on Windows
run: |
python -m pip install -U pip
python -m pip install --use-feature=2020-resolver -U poetry
poetry build
echo "Pip version:"
python -m pip --version
python -m pip install --use-feature=2020-resolver ${env:GITHUB_WORKSPACE}\dist\pelican-4.2.0-py3-none-any.whl
echo "Pelican version:"
pelican --version
python -m pip uninstall -y pelican
deploy:
name: Deploy
needs: [test, lint, docs]
@ -140,10 +192,10 @@ jobs:
- name: Check release
id: check_release
run: |
python -m pip install pip --upgrade
pip install poetry
pip install githubrelease
pip install --pre autopub
python -m pip install --use-feature=2020-resolver pip --upgrade
pip install --use-feature=2020-resolver poetry
pip install --use-feature=2020-resolver githubrelease
pip install --use-feature=2020-resolver --pre autopub
echo "##[set-output name=release;]$(autopub check)"
- name: Publish
if: ${{ steps.check_release.outputs.release=='' }}

View file

@ -43,7 +43,7 @@ publicly-accessible location:
* Describe what version of Pelican you are running (output of ``pelican --version``
or the HEAD commit hash if you cloned the repo) and how exactly you installed
it (the full command you used, e.g. ``pip install pelican``).
it (the full command you used, e.g. ``python -m pip install pelican``).
* If you are looking for a way to get some end result, prepare a detailed
description of what the end result should look like (preferably in the form of
an image or a mock-up page) and explain in detail what you have done so far to

View file

@ -44,9 +44,9 @@ to manually create and activate a virtual environment::
Install the needed dependencies and set up the project::
pip install invoke
python -m pip install invoke
invoke setup
pip install -e ~/projects/pelican
python -m pip install -e ~/projects/pelican
Your local environment should now be ready to go!

View file

@ -74,7 +74,7 @@ Markdown format, you will need to explicitly install the Markdown library. You
can do so by typing the following command, prepending ``sudo`` if permissions
require it::
pip install markdown
python -m pip install markdown
Can I use arbitrary metadata in my templates?
=============================================

View file

@ -1,19 +1,17 @@
Installing Pelican
##################
Pelican currently runs best on Python 2.7.x and 3.5+; earlier versions of
Python are not supported.
Pelican currently runs best on 3.6+; earlier versions of Python are not supported.
You can install Pelican via several different methods. The simplest is via
`pip <https://pip.pypa.io/en/stable/>`_::
You can install Pelican via several different methods. The simplest is via Pip_::
pip install pelican
python -m pip install pelican
Or, if you plan on using Markdown::
pip install pelican[Markdown]
python -m pip install "pelican[markdown]"
(Keep in mind that operating systems will often require you to prefix the above
(Keep in mind that some operating systems will require you to prefix the above
command with ``sudo`` in order to install Pelican system-wide.)
While the above is the simplest method, the recommended approach is to create a
@ -26,7 +24,7 @@ session and create a new virtual environment for Pelican::
source bin/activate
Once the virtual environment has been created and activated, Pelican can be
installed via ``pip install pelican`` as noted above. Alternatively, if you
installed via ``python -m pip install pelican`` as noted above. Alternatively, if you
have the project source, you can install Pelican using the distutils method::
cd path-to-Pelican-source
@ -35,7 +33,7 @@ have the project source, you can install Pelican using the distutils method::
If you have Git installed and prefer to install the latest bleeding-edge
version of Pelican rather than a stable release, use the following command::
pip install -e "git+https://github.com/getpelican/pelican.git#egg=pelican"
python -m pip install -e "git+https://github.com/getpelican/pelican.git#egg=pelican"
Once Pelican is installed, you can run ``pelican --help`` to see basic usage
options. For more detail, refer to the :doc:`Publish<publish>` section.
@ -46,17 +44,13 @@ Optional packages
If you plan on using `Markdown <https://pypi.org/project/Markdown/>`_ as a
markup format, you can install Pelican with Markdown support::
pip install pelican[Markdown]
Or you might need to install it a posteriori::
pip install Markdown
python -m pip install "pelican[markdown]"
Typographical enhancements can be enabled in your settings file, but first the
requisite `Typogrify <https://pypi.org/project/typogrify/>`_ library must be
installed::
pip install typogrify
python -m pip install typogrify
Dependencies
------------
@ -75,9 +69,8 @@ automatically installed without any action on your part:
broadcast signaling system
* `unidecode <https://pypi.org/project/Unidecode/>`_, for ASCII
transliterations of Unicode text
* `six <https://pypi.org/project/six/>`_, for Python 2 and 3 compatibility
utilities
* `MarkupSafe <https://pypi.org/project/MarkupSafe/>`_, for a markup safe
* `MarkupSafe <https://pypi.org/project/MarkupSafe/>`_, for a markup-safe
string implementation
* `python-dateutil <https://pypi.org/project/python-dateutil/>`_, to read
the date metadata
@ -85,10 +78,10 @@ automatically installed without any action on your part:
Upgrading
---------
If you installed a stable Pelican release via ``pip`` and wish to upgrade to
If you installed a stable Pelican release via Pip_ and wish to upgrade to
the latest stable release, you can do so by adding ``--upgrade``::
pip install --upgrade pelican
python -m pip install --upgrade pelican
If you installed Pelican via distutils or the bleeding-edge method, simply
perform the same step to install the most recent version.
@ -126,4 +119,5 @@ content)::
The next step is to begin to adding content to the *content* folder that has
been created for you.
.. _Pip: https://pip.pypa.io/
.. _virtualenv: https://virtualenv.pypa.io/en/latest/

View file

@ -44,17 +44,22 @@ HTML content and some metadata.
Take a look at the Markdown reader::
from pelican.readers import BaseReader
from pelican.utils import pelican_open
from markdown import Markdown
class MarkdownReader(BaseReader):
enabled = bool(Markdown)
enabled = True
def read(self, source_path):
"""Parse content and metadata of markdown files"""
text = pelican_open(source_path)
md_extensions = {'markdown.extensions.meta': {},
'markdown.extensions.codehilite': {}}
md = Markdown(extensions=md_extensions.keys(),
extension_configs=md_extensions)
content = md.convert(text)
with pelican_open(source_path) as text:
md_extensions = {'markdown.extensions.meta': {},
'markdown.extensions.codehilite': {}}
md = Markdown(extensions=md_extensions.keys(),
extension_configs=md_extensions)
content = md.convert(text)
metadata = {}
for name, value in md.Meta.items():

View file

@ -118,7 +118,7 @@ in a wide range of environments. The downside is that it must be installed
separately. Use the following command to install Invoke, prefixing with
``sudo`` if your environment requires it::
pip install invoke
python -m pip install invoke
Take a moment to open the ``tasks.py`` file that was generated in your project
root. You will see a number of commands, any one of which can be renamed,
@ -139,7 +139,7 @@ http://localhost:8000/::
invoke serve
To serve the generated site with automatic browser reloading every time a
change is detected, first ``pip install livereload``, then use the
change is detected, first ``python -m pip install livereload``, then use the
following command::
invoke livereload

View file

@ -8,10 +8,10 @@ Installation
------------
Install Pelican (and optionally Markdown if you intend to use it) on Python
2.7.x or Python 3.5+ by running the following command in your preferred
terminal, prefixing with ``sudo`` if permissions warrant::
3.6+ by running the following command in your preferred terminal, prefixing
with ``sudo`` if permissions warrant::
pip install pelican[Markdown]
python -m pip install "pelican[markdown]"
Create a project
----------------

View file

@ -9,6 +9,12 @@ line::
If you used the ``pelican-quickstart`` command, your primary settings file will
be named ``pelicanconf.py`` by default.
You can also specify extra settings via ``-e`` / ``--extra-settings`` option
flags, which will override default settings as well as any defined within
settings files::
pelican content -e DELETE_OUTPUT_DIRECTORY=true
.. note::
When experimenting with different settings (especially the metadata ones)
@ -271,7 +277,7 @@ Basic settings
If set to True, several typographical improvements will be incorporated into
the generated HTML via the `Typogrify
<https://pypi.python.org/pypi/typogrify>`_ library, which can be installed
via: ``pip install typogrify``
via: ``python -m pip install typogrify``
.. data:: TYPOGRIFY_IGNORE_TAGS = []
@ -297,10 +303,10 @@ Basic settings
does not otherwise specify a summary. Setting to ``None`` will cause the
summary to be a copy of the original content.
.. data:: SUMMARY_END_MARKER = '…'
.. data:: SUMMARY_END_SUFFIX = '…'
When creating a short summary of an article and the result was truncated to
match the required word length, this will be used as the truncation marker.
match the required word length, this will be used as the truncation suffix.
.. data:: WITH_FUTURE_DATES = True
@ -770,7 +776,7 @@ Template pages
.. data:: TEMPLATE_PAGES = None
A mapping containing template pages that will be rendered with the blog
entries. See :ref:`template_pages`.
entries.
If you want to generate custom pages besides your blog entries, you can
point any Jinja2 template file with a path pointing to the file and the

View file

@ -23,7 +23,7 @@ from pelican.plugins import signals
from pelican.plugins._utils import load_plugins
from pelican.readers import Readers
from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer
from pelican.settings import read_settings
from pelican.settings import coerce_overrides, read_settings
from pelican.utils import (FileSystemWatcher, clean_output_dir, maybe_pluralize)
from pelican.writers import Writer
@ -230,6 +230,18 @@ class PrintSettings(argparse.Action):
parser.exit()
class ParseDict(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
d = {}
if values:
for item in values:
split_items = item.split("=", 1)
key = split_items[0].strip()
value = split_items[1].strip()
d[key] = value
setattr(namespace, self.dest, d)
def parse_arguments(argv=None):
parser = argparse.ArgumentParser(
description='A tool to generate a static blog, '
@ -323,6 +335,16 @@ def parse_arguments(argv=None):
help='IP to bind to when serving files via HTTP '
'(default: 127.0.0.1)')
parser.add_argument('-e', '--extra-settings', dest='overrides',
help='Specify one or more SETTING=VALUE pairs to '
'override settings. If VALUE contains spaces, '
'add quotes: SETTING="VALUE". Values other than '
'integers and strings can be specified via JSON '
'notation. (e.g., SETTING=none)',
nargs='*',
action=ParseDict
)
args = parser.parse_args(argv)
if args.port is not None and not args.listen:
@ -358,6 +380,7 @@ def get_config(args):
if args.bind is not None:
config['BIND'] = args.bind
config['DEBUG'] = args.verbosity == logging.DEBUG
config.update(coerce_overrides(args.overrides))
return config

View file

@ -392,7 +392,7 @@ class Content:
return truncate_html_words(self.content,
self.settings['SUMMARY_MAX_LENGTH'],
self.settings['SUMMARY_END_MARKER'])
self.settings['SUMMARY_END_SUFFIX'])
@property
def summary(self):

View file

@ -227,7 +227,7 @@ class RstReader(BaseReader):
if element.tagname == 'field': # custom fields (e.g. summary)
name_elem, body_elem = element.children
name = name_elem.astext()
if name in formatted_fields:
if name.lower() in formatted_fields:
value = render_node_to_html(
document, body_elem,
self.field_body_translator_class)

View file

@ -1,6 +1,7 @@
import copy
import importlib.util
import inspect
import json
import locale
import logging
import os
@ -135,7 +136,7 @@ DEFAULT_CONFIG = {
'TYPOGRIFY': False,
'TYPOGRIFY_IGNORE_TAGS': [],
'TYPOGRIFY_DASHES': 'default',
'SUMMARY_END_MARKER': '',
'SUMMARY_END_SUFFIX': '',
'SUMMARY_MAX_LENGTH': 50,
'PLUGIN_PATHS': [],
'PLUGINS': None,
@ -658,3 +659,25 @@ def configure_settings(settings):
continue # setting not specified, nothing to do
return settings
def coerce_overrides(overrides):
if overrides is None:
return {}
coerced = {}
types_to_cast = {int, str, bool}
for k, v in overrides.items():
if k not in DEFAULT_CONFIG:
logger.warning('Override for unknown setting %s, ignoring', k)
continue
setting_type = type(DEFAULT_CONFIG[k])
if setting_type not in types_to_cast:
coerced[k] = json.loads(v)
else:
try:
coerced[k] = setting_type(v)
except ValueError:
logger.debug('ValueError for %s override with %s, try to '
'load as json', k, v)
coerced[k] = json.loads(v)
return coerced

View file

@ -0,0 +1,16 @@
This is a super article !
#########################
:TAGS: foo, bar, foobar
:DATE: 2010-12-02 10:14
:MODIFIED: 2010-12-02 10:20
:CATEGORY: yeah
:AUTHOR: Alexis Métaireau
:SUMMARY:
Multi-line metadata should be supported
as well as **inline markup** and stuff to "typogrify"...
:CUSTOM_FIELD: http://notmyidea.org
:CUSTOM_FORMATTED_FIELD:
Multi-line metadata should also be supported
as well as *inline markup* and stuff to "typogrify"...

View file

@ -110,14 +110,14 @@ class TestPage(TestBase):
page = Page(**page_kwargs)
self.assertEqual(page.summary, '')
def test_summary_end_marker(self):
# If a :SUMMARY_END_MARKER: is set, and there is no other summary,
def test_summary_end_suffix(self):
# If a :SUMMARY_END_SUFFIX: is set, and there is no other summary,
# generated summary should contain the specified marker at the end.
page_kwargs = self._copy_page_kwargs()
settings = get_settings()
page_kwargs['settings'] = settings
del page_kwargs['metadata']['summary']
settings['SUMMARY_END_MARKER'] = 'test_marker'
settings['SUMMARY_END_SUFFIX'] = 'test_marker'
settings['SUMMARY_MAX_LENGTH'] = 10
page = Page(**page_kwargs)
self.assertEqual(page.summary, truncate_html_words(TEST_CONTENT, 10,

View file

@ -260,6 +260,7 @@ class TestArticlesGenerator(unittest.TestCase):
['This is a super article !', 'published', 'yeah', 'article'],
['This is a super article !', 'published', 'yeah', 'article'],
['This is a super article !', 'published', 'yeah', 'article'],
['This is a super article !', 'published', 'yeah', 'article'],
['This is a super article !', 'published', 'Default', 'article'],
['Article with an inline SVG', 'published', 'Default', 'article'],
['This is an article with category !', 'published', 'yeah',
@ -576,6 +577,7 @@ class TestArticlesGenerator(unittest.TestCase):
'This is a super article !',
'This is a super article !',
'This is a super article !',
'This is a super article !',
'This is an article with category !',
('This is an article with multiple authors in lastname, '
'firstname format!'),

View file

@ -155,6 +155,24 @@ class RstReaderTest(ReaderTest):
self.assertDictHasSubset(page.metadata, expected)
def test_article_with_capitalized_metadata(self):
page = self.read_file(path='article_with_capitalized_metadata.rst')
expected = {
'category': 'yeah',
'author': 'Alexis Métaireau',
'title': 'This is a super article !',
'summary': '<p class="first last">Multi-line metadata should be'
' supported\nas well as <strong>inline'
' markup</strong> and stuff to &quot;typogrify'
'&quot;...</p>\n',
'date': SafeDatetime(2010, 12, 2, 10, 14),
'modified': SafeDatetime(2010, 12, 2, 10, 20),
'tags': ['foo', 'bar', 'foobar'],
'custom_field': 'http://notmyidea.org',
}
self.assertDictHasSubset(page.metadata, expected)
def test_article_with_filename_metadata(self):
page = self.read_file(
path='2012-11-29_rst_w_filename_meta#foo-bar.rst',

View file

@ -7,8 +7,8 @@ from sys import platform
from pelican.settings import (DEFAULT_CONFIG, DEFAULT_THEME,
_printf_s_to_format_field,
configure_settings, handle_deprecated_settings,
read_settings)
coerce_overrides, configure_settings,
handle_deprecated_settings, read_settings)
from pelican.tests.support import unittest
@ -304,3 +304,18 @@ class TestSettingsConfiguration(unittest.TestCase):
[(r'C\+\+', 'cpp')] +
self.settings['SLUG_REGEX_SUBSTITUTIONS'])
self.assertNotIn('SLUG_SUBSTITUTIONS', settings)
def test_coerce_overrides(self):
overrides = coerce_overrides({
'ARTICLE_EXCLUDES': '["testexcl"]',
'READERS': '{"foo": "bar"}',
'STATIC_EXCLUDE_SOURCES': 'true',
'THEME_STATIC_DIR': 'theme',
})
expected = {
'ARTICLE_EXCLUDES': ["testexcl"],
'READERS': {"foo": "bar"},
'STATIC_EXCLUDE_SOURCES': True,
'THEME_STATIC_DIR': 'theme',
}
self.assertDictEqual(overrides, expected)

View file

@ -41,7 +41,7 @@ _jinja_env = Environment(
_GITHUB_PAGES_BRANCHES = {
'personal': 'master',
'personal': 'main',
'project': 'gh-pages'
}

View file

@ -101,32 +101,16 @@ regenerate:
"$(PELICAN)" -r "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS)
serve:
ifdef PORT
"$(PELICAN)" -l "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) -p $(PORT)
else
"$(PELICAN)" -l "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS)
endif
serve-global:
ifdef PORT
"$(PELICAN)" -l "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) -p $(PORT) -b $(SERVER)
else
"$(PELICAN)" -l "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) -b $(SERVER)
endif
devserver:
ifdef PORT
"$(PELICAN)" -lr "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) -p $(PORT)
else
"$(PELICAN)" -lr "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS)
endif
devserver-global:
ifdef PORT
$(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b 0.0.0.0
else
$(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -b 0.0.0.0
endif
publish:
"$(PELICAN)" "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(PUBLISHCONF)" $(PELICANOPTS)
@ -139,7 +123,7 @@ ssh_upload: publish
{% set upload = upload + ["rsync_upload"] %}
rsync_upload: publish
rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --cvs-exclude --delete "$(OUTPUTDIR)"/ "$(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)"
rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --include tags --cvs-exclude --delete "$(OUTPUTDIR)"/ "$(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)"
{% endif %}
{% if dropbox %}

View file

@ -18,45 +18,48 @@ classifiers = [
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries :: Python Modules",
]
[tool.poetry.urls]
"Funding" = "https://donate.getpelican.com/"
"Tracker" = "https://github.com/getpelican/pelican/issues"
[tool.poetry.dependencies]
python = "^3.6"
blinker = "^1.4"
docutils = "^0.16"
feedgenerator = "^1.9"
jinja2 = "~2.11"
pygments = "~2.6.1"
pytz = "^2019.1"
blinker = "^1.4"
unidecode = "^1.1"
python-dateutil = "^2.8"
docutils = "^0.15"
markdown = {version = "~3.1.1", optional = true}
pytz = "^2020.1"
unidecode = "^1.1"
markdown = {version = "~3.2.2", optional = true}
[tool.poetry.dev-dependencies]
BeautifulSoup4 = "^4.7"
BeautifulSoup4 = "^4.9"
lxml = "^4.3"
markdown = "~3.1.1"
markdown = "~3.2.2"
typogrify = "^2.0"
sphinx = "=1.4.9"
sphinx_rtd_theme = "^0.4.3"
sphinx = "^3.0"
sphinx_rtd_theme = "^0.5"
livereload = "^2.6"
mock = "^3.0"
pytest = "~5.3.5"
pytest = "^6.0"
pytest-cov = "^2.8"
pytest-pythonpath = "^0.7.3"
pytest-sugar = "^0.9.2"
pytest-xdist = "^1.31"
pytest-sugar = "^0.9.4"
pytest-xdist = "^2.0"
tox = "^3.13"
flake8 = "^3.7"
flake8 = "^3.8"
flake8-import-order = "^0.18.1"
invoke = "^1.3"
isort = "^4.3.21"
isort = "^5.2"
black = {version = "^19.10b0", allow-prereleases = true}
[tool.poetry.extras]
@ -64,6 +67,10 @@ markdown = ["markdown"]
[tool.poetry.scripts]
pelican = "pelican.__main__:main"
pelican-import = "pelican.tools.pelican_import:main"
pelican-plugins = "pelican.plugins._utils:list_plugins"
pelican-quickstart = "pelican.tools.pelican_quickstart:main"
pelican-themes = "pelican.tools.pelican_themes:main"
[tool.autopub]
project-name = "Pelican"
@ -76,4 +83,5 @@ version-strings = ["setup.py"]
build-system = "setuptools"
[build-system]
requires = ["setuptools >= 40.6.0", "wheel"]
requires = ["poetry>=1.0"]
build-backend = "poetry.masonry.api"

View file

@ -1,6 +1,6 @@
# Tests
Pygments==2.6.1
pytest==5.3.5
pytest
pytest-cov
pytest-xdist

View file

@ -3,7 +3,7 @@
from os import walk
from os.path import join, relpath
from setuptools import setup
from setuptools import setup, find_packages
version = "4.2.0"
@ -44,19 +44,14 @@ setup(
keywords='static web site generator SSG reStructuredText Markdown',
license='AGPLv3',
long_description=description,
packages=['pelican', 'pelican.tools', 'pelican.plugins'],
package_data={
# we manually collect the package data, as opposed to using,
# include_package_data=True because we don't want the tests to be
# included automatically as package data (MANIFEST.in is too greedy)
packages=find_packages(),
include_package_data=True, # includes all in MANIFEST.in if in package
# NOTE : This will collect any files that happen to be in the themes
# directory, even though they may not be checked into version control.
package_data={ # pelican/themes is not a package, so include manually
'pelican': [relpath(join(root, name), 'pelican')
for root, _, names in walk(join('pelican', 'themes'))
for name in names],
'pelican.tools': [relpath(join(root, name), join('pelican', 'tools'))
for root, _, names in walk(join('pelican',
'tools',
'templates'))
for name in names],
},
install_requires=requires,
extras_require={

View file

@ -64,7 +64,7 @@ def isort(c, check=False, diff=False):
if diff:
diff_flag = "--diff"
c.run(
f"{VENV_BIN}/isort {check_flag} {diff_flag} --recursive {PKG_PATH}/* tasks.py"
f"{VENV_BIN}/isort {check_flag} {diff_flag} ."
)

View file

@ -28,7 +28,7 @@ commands =
filterwarnings =
default::DeprecationWarning
error:.*:Warning:pelican
addopts = -n 2 -r a
addopts = -n auto -r a
[flake8]
application-import-names = pelican