Skip to content

Commit

Permalink
allow latest python 3. added black and flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
TimidRobot committed Sep 25, 2020
1 parent d1bc409 commit 7e0daf1
Show file tree
Hide file tree
Showing 7 changed files with 296 additions and 118 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
exclude =
.git,
webpack
6 changes: 3 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
black = "==19.10b0"
flake8 = "*"
lektor = "*"
# Werkzeug added and pinned to mitigate this issue:
# https://github.com/nixjdm/lektor-atom/issues/23
Werkzeug = "==0.16.1"

[requires]
python_version = "3.7"
python_version = "3"
338 changes: 250 additions & 88 deletions Pipfile.lock

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions packages/checkfile/lektor_checkfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@


class CheckfilePlugin(Plugin):
name = 'CheckFile'
description = u'Plugin to check if a file is present.'
name = "CheckFile"
description = u"Plugin to check if a file is present."

def on_setup_env(self, **extra):

def check_file(filename):
fn = os.path.join(self.env.root_path, filename)
assert os.path.isfile(fn), 'file {} does not exist'.format(fn)
assert os.path.isfile(fn), "file {} does not exist".format(fn)
return ""
self.env.jinja_env.globals.update(
check_file=check_file
)

self.env.jinja_env.globals.update(check_file=check_file)
40 changes: 21 additions & 19 deletions packages/checkfile/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,37 @@

from setuptools import setup, find_packages

with io.open('README.md', 'rt', encoding="utf8") as f:
with io.open("README.md", "rt", encoding="utf8") as f:
readme = f.read()

_description_re = re.compile(r'description\s+=\s+(?P<description>.*)')
_description_re = re.compile(r"description\s+=\s+(?P<description>.*)")

with open('lektor_checkfile.py', 'rb') as f:
description = str(ast.literal_eval(_description_re.search(
f.read().decode('utf-8')).group(1)))
with open("lektor_checkfile.py", "rb") as f:
description = str(
ast.literal_eval(
_description_re.search(f.read().decode("utf-8")).group(1)
)
)

setup(
author='mayank',
author_email='[email protected]',
author="mayank",
author_email="[email protected]",
description=description,
keywords='Lektor plugin',
license='MIT',
keywords="Lektor plugin",
license="MIT",
long_description=readme,
long_description_content_type='text/markdown',
name='lektor-checkfile',
long_description_content_type="text/markdown",
name="lektor-checkfile",
packages=find_packages(),
py_modules=['lektor_checkfile'],
py_modules=["lektor_checkfile"],
# url='[link to your repository]',
version='0.1',
version="0.1",
classifiers=[
'Framework :: Lektor',
'Environment :: Plugins',
"Environment :: Plugins",
"Framework :: Lektor",
"Programming Language :: Python :: 3",
],
entry_points={
'lektor.plugins': [
'checkfile = lektor_checkfile:CheckfilePlugin',
]
}
"lektor.plugins": ["checkfile = lektor_checkfile:CheckfilePlugin",] # noqa: E231, E501
},
)
6 changes: 5 additions & 1 deletion packages/markdown-table/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
py_modules=["lektor_markdown_table"],
url="https://github.com/sp35/lektor-markdown-table",
version="0.1",
classifiers=["Framework :: Lektor", "Environment :: Plugins", ],
classifiers=[
"Framework :: Lektor",
"Environment :: Plugins",
"Programming Language :: Python :: 3",
],
entry_points={
"lektor.plugins": [
"markdown-table = lektor_markdown_table:MarkdownTablePlugin",
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[tool.black]
line-length = 79
exclude = '''
/(
\.git
| webpack
)/
'''

0 comments on commit 7e0daf1

Please sign in to comment.