Skip to content

Commit df37cd7

Browse files
authored
Merge branch 'master' into check_diff
2 parents d9c2dd9 + 782cb22 commit df37cd7

File tree

15 files changed

+50
-79
lines changed

15 files changed

+50
-79
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
commit = True
33
tag = True
44
tag_name = {new_version}
5-
current_version = 0.7.16
5+
current_version = 0.7.17
66

77
[bumpversion:file:pyproject.toml]
88
search = version = "{current_version}" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT

.github/workflows/tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
runs-on: ${{ matrix.os }}
3434
strategy:
3535
matrix:
36-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12-dev']
36+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12-dev']
3737
os: [ubuntu-latest, macos-latest, windows-latest]
3838
continue-on-error: ${{ matrix.python-version == '3.12-dev' }}
3939

@@ -74,7 +74,7 @@ jobs:
7474
- uses: actions/checkout@v3
7575
- uses: actions/setup-python@v3
7676
with:
77-
python-version: '3.7'
77+
python-version: '3.8'
7878
- name: Install build and publish tools
7979
run: |
8080
pip install build twine

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: 3298ddab3c13dd77d6ce1fc0baf97691430d84b0 # frozen: v4.3.0
3+
rev: f71fa2c1f9cf5cb705f73dffe4b21f7c61470ba9 # frozen: v4.4.0
44
hooks:
55
- id: check-yaml
66
- id: check-toml
77
- repo: https://github.com/pre-commit/pygrep-hooks
8-
rev: 6f51a66bba59954917140ec2eeeaa4d5e630e6ce # frozen: v1.9.0
8+
rev: 3a6eb0fadf60b3cccfd80bad9dbb6fae7e47b316 # frozen: v1.10.0
99
hooks:
1010
- id: python-use-type-annotations
1111
- id: python-check-blanket-noqa
1212
- id: python-check-blanket-type-ignore
1313
- repo: https://github.com/asottile/yesqa
14-
rev: 265e9ff7c83add4949f81bb5fe14f4a743ffb04c # frozen: v1.4.0
14+
rev: f2ae90cf9e1661ade79d0881186ce4fd7ba6ee79 # frozen: v1.5.0
1515
hooks:
1616
- id: yesqa
1717
additional_dependencies:
@@ -23,19 +23,19 @@ repos:
2323
hooks:
2424
- id: absolufy-imports
2525
- repo: https://github.com/PyCQA/isort
26-
rev: c5e8fa75dda5f764d20f66a215d71c21cfa198e1 # frozen: 5.10.1
26+
rev: dbf82f2dd09ae41d9355bcd7ab69187a19e6bf2f # frozen: 5.12.0
2727
hooks:
2828
- id: isort
2929
- repo: https://github.com/psf/black
30-
rev: f6c139c5215ce04fd3e73a900f1372942d58eca0 # frozen: 22.6.0
30+
rev: 193ee766ca496871f93621d6b58d57a6564ff81b # frozen: 23.7.0
3131
hooks:
3232
- id: black
3333
- repo: https://github.com/myint/docformatter
34-
rev: e0c24db9430c0df94a077c07af2e1de536689c5f # frozen: v1.5.0-rc1
34+
rev: dfefe062799848234b4cd60b04aa633c0608025e # frozen: v1.7.5
3535
hooks:
3636
- id: docformatter
3737
- repo: https://github.com/PyCQA/flake8
38-
rev: f8e1b317742036ff11ff86356fd2b68147e169f7 # frozen: 5.0.4
38+
rev: 10f4af6dbcf93456ba7df762278ae61ba3120dc6 # frozen: 6.1.0
3939
hooks:
4040
- id: flake8
4141
additional_dependencies:

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ sphinx:
1111

1212
# Optionally set the version of Python and requirements required to build your docs
1313
python:
14-
version: '3.7'
14+
version: '3.8'
1515
install:
1616
- requirements: docs/requirements.txt

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
author = 'Taneli Hukkinen'
2424

2525
# The full version, including alpha/beta/rc tags
26-
release = '0.7.16' # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
26+
release = '0.7.17' # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
2727

2828

2929
# -- General configuration ---------------------------------------------------

docs/users/changelog.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
This log documents all Python API or CLI breaking backwards incompatible changes.
44
Note that there is currently no guarantee for a stable Markdown formatting style across versions.
55

6+
## 0.7.17
7+
8+
- Added
9+
- Do not update mtime if formatting result is identical to the file.
10+
Thank you, [Pierre Augier](https://github.com/paugier), for the issue and the PR.
11+
- Fixed
12+
- An error on empty paragraph (Unicode space only).
13+
Thank you, [Nico Schlömer](https://github.com/nschloe), for the issue.
14+
- File write fails if no permissions to write to the directory.
15+
Fixed by removing atomic writes.
16+
Thank you, [Guy Kisel](https://github.com/guykisel), for the issue.
17+
- File permissions change on rewrite.
18+
Thank you, [Keiichi Watanabe](https://github.com/keiichiw), for the issue.
19+
- Removed
20+
- Python 3.7 support
21+
622
## 0.7.16
723

824
- Added

docs/users/installation_and_usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Add the following to your project's `.pre-commit-config.yaml` to enable this:
6868

6969
```yaml
7070
- repo: https://github.com/executablebooks/mdformat
71-
rev: 0.7.16 # Use the ref you want to point at
71+
rev: 0.7.17 # Use the ref you want to point at
7272
hooks:
7373
- id: mdformat
7474
# Optionally add plugins

pyproject.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@ build-backend = "setuptools.build_meta"
55

66
[project]
77
name = "mdformat"
8-
version = "0.7.16" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
8+
version = "0.7.17" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
99
description = "CommonMark compliant Markdown formatter"
1010
authors = [
1111
{ name = "Taneli Hukkinen", email = "[email protected]" },
1212
]
1313
license = { file = "LICENSE" }
14-
requires-python = ">=3.7"
14+
requires-python = ">=3.8"
1515
dependencies = [
16+
'markdown-it-py >=1.0.0,<4.0.0',
1617
'tomli >=1.1.0; python_version < "3.11"',
17-
'markdown-it-py >=1.0.0,<3.0.0',
1818
'importlib-metadata >=3.6.0; python_version < "3.10"',
19-
'typing-extensions >=3.7.4; python_version < "3.8"',
2019
]
2120
readme = "README.md"
2221
classifiers = [
@@ -64,10 +63,10 @@ xfail_strict = true
6463
legacy_tox_ini = '''
6564
[tox]
6665
# Only run pytest envs when no args given to tox
67-
envlist = py{37,38,39,310}
66+
envlist = py{38,39,310,311}
6867
isolated_build = True
6968
70-
[testenv:py{37,38,39,310}]
69+
[testenv:py{38,39,310,311}]
7170
description = run tests
7271
deps =
7372
-r tests/requirements.txt

src/mdformat/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
__all__ = ("file", "text")
2-
__version__ = "0.7.16" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
2+
__version__ = "0.7.17" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
33

44
from mdformat._api import file, text

src/mdformat/_api.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@
77
from typing import Any
88

99
from mdformat._conf import DEFAULT_OPTS
10-
from mdformat._util import (
11-
EMPTY_MAP,
12-
NULL_CTX,
13-
atomic_write,
14-
build_mdit,
15-
detect_newline_type,
16-
)
10+
from mdformat._util import EMPTY_MAP, NULL_CTX, build_mdit, detect_newline_type
1711
from mdformat.renderer import MDRenderer
1812

1913

@@ -75,4 +69,6 @@ def file(
7569
newline = detect_newline_type(
7670
original_md, options.get("end_of_line", DEFAULT_OPTS["end_of_line"])
7771
)
78-
atomic_write(f, formatted_md, newline)
72+
formatted_md = formatted_md.replace("\n", newline)
73+
if formatted_md != original_md:
74+
f.write_bytes(formatted_md.encode())

0 commit comments

Comments
 (0)