Skip to content

Commit 502b287

Browse files
authored
Merge pull request creativecommons#613 from creativecommons/python-updates
Python updates
2 parents a5e5a79 + 3579213 commit 502b287

File tree

9 files changed

+155
-113
lines changed

9 files changed

+155
-113
lines changed

.github/workflows/lektor-build-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
- name: setup python version
99
uses: actions/setup-python@v1
1010
with:
11-
python-version: 3.7
11+
python-version: 3.9
1212
- name: Install dependencies
1313
run: |
1414
pip install pipenv
15-
pipenv install
15+
pipenv sync
1616
pipenv run lektor build -f webpack
1717
- name: Deploy to production
1818
if: github.ref == 'refs/heads/master'

Pipfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ url = "https://pypi.org/simple"
44
verify_ssl = true
55

66
[packages]
7-
black = "==19.10b0"
7+
black = "==20.8b1"
88
# Cryptography 3.4+ requires Rust to build
99
# https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst
1010
cryptography = "==3.3.2"
1111
flake8 = "*"
12+
isort = "*"
1213
lektor = "*"
1314
# Werkzeug added and pinned to mitigate this issue:
1415
# https://github.com/nixjdm/lektor-atom/issues/23
1516
Werkzeug = "==0.16.1"
1617

1718
[requires]
18-
python_version = "3"
19+
python_version = "3.9"

Pipfile.lock

Lines changed: 102 additions & 88 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,27 +57,27 @@ To install these, execute the following commands:
5757

5858
> For macOS:
5959
60-
1. `brew install pipenv`
61-
2. `brew install node`
60+
1. `brew install pipenv node`
6261

6362
> For GNU/Linux:
6463
65-
1. `curl https://raw.githubusercontent.com/kennethreitz/pipenv/master/get-pipenv.py | python`
66-
2. `sudo apt update`
67-
3. [Install Node.js](https://github.com/nodesource/distributions/blob/master/README.md#table-of-contents)
64+
1. [Installing Pipenv][pipenvinstall]
65+
2. [Install Node.js][nodeinstall]
66+
3. `sudo apt update`
6867
4. `sudo apt install npm `
6968

70-
[pipenvdocs]:https://pipenv.readthedocs.io/en/latest/
71-
[nodejswebsite]:https://nodejs.org/en/
72-
[npmdocs]:https://docs.npmjs.com/
73-
69+
[pipenvdocs]: https://pipenv.pypa.io/en/latest/
70+
[nodejswebsite]: https://nodejs.org/en/
71+
[npmdocs]: https://docs.npmjs.com/
72+
[pipenvinstall]: https://pipenv.pypa.io/en/latest/install/#installing-pipenv
73+
[nodeinstall]: https://github.com/nodesource/distributions/blob/master/README.md#table-of-contents
7474

7575

7676
### Installing Project Requirements
7777

7878
1. Clone this repository.
7979
2. Open your command line interface and `cd` to the repository root directory.
80-
3. Run `pipenv install` to create a Python virtual environment and install the requirements for this project.
80+
3. Run `pipenv install --dev` to create a Python virtual environment and install the requirements for this project.
8181

8282

8383
### pipenv Troubleshooting
@@ -86,7 +86,7 @@ To install these, execute the following commands:
8686
message if the project’s virtual environment is broken][pipenverror]). If all
8787
else fails, try removing the virtual environment and reinstalling:
8888
1. `pipenv --rm`
89-
2. `pipenv install`
89+
2. `pipenv install --dev`
9090

9191
[pipenverror]:https://github.com/pypa/pipenv/issues/1918
9292

packages/checkfile/lektor_checkfile.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# -*- coding: utf-8 -*-
2+
# Standard library
23
import os
4+
5+
# Third-party
36
from lektor.pluginsystem import Plugin
47

58

69
class CheckfilePlugin(Plugin):
710
name = "CheckFile"
8-
description = u"Plugin to check if a file is present."
11+
description = "Plugin to check if a file is present."
912

1013
def on_setup_env(self, **extra):
1114
def check_file(filename):

packages/checkfile/setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
# Standard library
12
import ast
23
import io
34
import re
45

5-
from setuptools import setup, find_packages
6+
# Third-party
7+
from setuptools import find_packages, setup
68

79
with io.open("README.md", "rt", encoding="utf8") as f:
810
readme = f.read()
@@ -35,6 +37,8 @@
3537
"Programming Language :: Python :: 3",
3638
],
3739
entry_points={
38-
"lektor.plugins": ["checkfile = lektor_checkfile:CheckfilePlugin",] # noqa: E231, E501
40+
"lektor.plugins": [
41+
"checkfile = lektor_checkfile:CheckfilePlugin",
42+
]
3943
},
4044
)

packages/markdown-table/lektor_markdown_table.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
# Third-party
23
from lektor.pluginsystem import Plugin
34

45

packages/markdown-table/setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
from setuptools import setup, find_packages
1+
# Standard library
22
from os import path
33

4+
# Third-party
5+
from setuptools import find_packages, setup
46

57
this_directory = path.abspath(path.dirname(__file__))
68
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:

pyproject.toml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
[tool.black]
2-
line-length = 79
3-
exclude = '''
4-
/(
5-
\.git
6-
| webpack
7-
)/
2+
force-exclude = '''
3+
(
4+
/node_modules/
5+
| /venv/
6+
)
87
'''
8+
line-length = 79
9+
target-version = ['py38']
10+
11+
12+
# [tool.flake8]
13+
# config: .flake8
14+
# also see: https://gitlab.com/pycqa/flake8/-/issues/428
15+
16+
17+
[tool.isort]
18+
import_heading_firstparty = 'First-party/Local'
19+
import_heading_future = 'Future'
20+
import_heading_stdlib = 'Standard library'
21+
import_heading_thirdparty = 'Third-party'
22+
line_length = 79
23+
multi_line_output = 3
24+
no_lines_before = 'LOCALFOLDER'
25+
profile = 'black'

0 commit comments

Comments
 (0)