Skip to content

Commit c7a1456

Browse files
authored
Merge pull request #11 from jsickcodes/drop-py-pandoc
Drop py pandoc (0.3.0 release)
2 parents fb92574 + 5a7b581 commit c7a1456

7 files changed

Lines changed: 62 additions & 20 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: CI
22

3-
"on": ["pull_request", "push"]
3+
"on":
4+
pull_request:
5+
push:
6+
branches: [main]
47

58
jobs:
69
pre-commit:
@@ -12,7 +15,7 @@ jobs:
1215

1316
- uses: actions/setup-python@v2
1417

15-
- uses: pre-commit/action@v2.0.0
18+
- uses: pre-commit/action@v2.0.3
1619

1720
typing:
1821
runs-on: ubuntu-latest
@@ -23,8 +26,6 @@ jobs:
2326

2427
- name: Set up Python
2528
uses: actions/setup-python@v2
26-
with:
27-
python-version: 3.8
2829

2930
- name: Python install
3031
run: |
@@ -55,6 +56,9 @@ jobs:
5556
with:
5657
python-version: ${{ matrix.python-version }}
5758

59+
- name: Install pandoc
60+
run: brew install pandoc
61+
5862
- name: Python install
5963
run: |
6064
python -m pip install --upgrade pip

CHANGELOG.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
Change log
22
==========
33

4-
Unreleased
5-
----------
4+
0.3.0 (2021-05-12)
5+
------------------
66

77
- Trim trailing whitespace from the output.
8+
- Drop ``py-pandoc`` as a default dependency.
9+
To get pandoc, you can install it with your system's package manager (such as homebrew or apt-get).
10+
Alternatively, you can directly install pre-commit-docx-plain using the ``[pandoc]`` extra to install pandoc through the ``py-pandoc`` PyPI package.
11+
However, we've found that py-pandoc cannot be installed reliably as a dependency of a pre-commit hook.
812

913
0.2.0 (2021-03-23)
1014
------------------

README.rst

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ At the root of your document's Git repository, add a file named ``.pre-commit-co
1515

1616
repos:
1717
- repo: https://github.com/jsickcodes/pre-commit-docx-plain
18-
rev: 0.1.0
18+
rev: 0.3.0
1919
hooks:
2020
- id: docxplain
2121

@@ -53,7 +53,10 @@ If the repository does not already have a GitHub Actions workflow, create a file
5353

5454
name: CI
5555

56-
"on": [push, pull_request]
56+
'on':
57+
pull_request:
58+
push:
59+
branches: [main]
5760

5861
jobs:
5962
pre-commit:
@@ -65,8 +68,11 @@ If the repository does not already have a GitHub Actions workflow, create a file
6568
- name: Set up Python
6669
uses: actions/setup-python@v2
6770

71+
- name: Install pandoc
72+
run: brew install pandoc
73+
6874
- name: Run pre-commit hooks
69-
uses: pre-commit/action@v2.0.0
75+
uses: pre-commit/action@v2.0.3
7076

7177
This workflow will generate a build "failure" if the plain-text mirror file is out of date with the Word file in the repository — as might happen if a contributor did not install pre-commit locally.
7278

@@ -78,7 +84,10 @@ The ``.github/workflows/ci.yaml`` file::
7884

7985
name: CI
8086

81-
"on": [push, pull_request]
87+
'on':
88+
pull_request:
89+
push:
90+
branches: [main]
8291

8392
jobs:
8493
pre-commit:
@@ -92,8 +101,11 @@ The ``.github/workflows/ci.yaml`` file::
92101
- name: Set up Python
93102
uses: actions/setup-python@v2
94103

104+
- name: Install pandoc
105+
run: brew install pandoc
106+
95107
- name: Run pre-commit hooks
96-
uses: pre-commit/action@v2.0.0
108+
uses: pre-commit/action@v2.0.3
97109
with:
98110
token: ${{ secrets.GITHUB_TOKEN }}
99111

@@ -115,7 +127,7 @@ However, you can customize the suffix of the file name by setting a ``--suffix``
115127

116128
repos:
117129
- repo: https://github.com/jsickcodes/pre-commit-docx-plain
118-
rev: 0.2.0
130+
rev: 0.3.0
119131
hooks:
120132
- id: docxplain
121133
args:
@@ -130,7 +142,7 @@ This is useful for explaining that the file is autogenerated::
130142

131143
repos:
132144
- repo: https://github.com/jsickcodes/pre-commit-docx-plain
133-
rev: 0.2.0
145+
rev: 0.3.0
134146
hooks:
135147
- id: docxplain
136148
args:
@@ -141,9 +153,30 @@ You can also insert the name of the source docx file using Python format string
141153

142154
repos:
143155
- repo: https://github.com/jsickcodes/pre-commit-docx-plain
144-
rev: 0.2.0
156+
rev: 0.3.0
145157
hooks:
146158
- id: docxplain
147159
args:
148160
- "--header"
149161
- "This file is autogenerated from {docx}. Do not edit."
162+
163+
Development guide
164+
=================
165+
166+
Release procedure
167+
-----------------
168+
169+
From the pull request:
170+
171+
1. Update the `changelog <CHANGELOG.rst>`__
172+
2. Update the version numbers in the ``.pre-commit-config.yaml`` code samples in the README.
173+
3. Update the version in `setup.cfg <setup.cfg>`__.
174+
175+
Next, merge the PR to the ``main`` branch once checks pass.
176+
177+
Finally, create a Release using the GitHub Release UI from the ``main`` branch. The tag name should be the semantic version set in the first step.
178+
179+
Project information
180+
===================
181+
182+
pre-commit-docx-plain is developed and maintained by J.Sick Codes Inc.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
[build-system]
22
requires = [
33
"setuptools>=42",
4-
"wheel",
5-
"setuptools_scm[toml]>=3.4"
4+
"wheel"
65
]
76
build-backend = 'setuptools.build_meta'
87

setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[metadata]
22
name = docxplain
3+
version = 0.3.0
34
description = Convert Office (docx) files to plain text using pandoc.
45
author = Jonathan Sick
56
author_email = hi@jsick.codes
@@ -28,12 +29,9 @@ package_dir =
2829
= src
2930
packages = find:
3031
python_requires = >=3.7
31-
setup_requires =
32-
setuptools_scm
3332
install_requires =
3433
importlib_metadata; python_version < "3.8"
3534
pypandoc
36-
py-pandoc
3735

3836
[options.packages.find]
3937
where = src
@@ -43,6 +41,8 @@ console_scripts =
4341
docxplain = docxplain.cli:main
4442

4543
[options.extras_require]
44+
pandoc =
45+
py-pandoc
4646
dev =
4747
pytest
4848

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from setuptools import setup
22

3-
setup(use_scm_version=True)
3+
setup()

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ skip_missing_interpreters = True
1111
description = Run unit tests
1212
extras =
1313
dev
14+
allowlist_externals =
15+
pandoc
1416
commands=
1517
pytest {posargs}
1618

0 commit comments

Comments
 (0)