Skip to content

Commit

Permalink
Merge dc875a7 into ed34700
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed Dec 15, 2022
2 parents ed34700 + dc875a7 commit 06e7d39
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 45 deletions.
36 changes: 10 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,24 @@ jobs:
- platform: ubuntu-latest
python-version: '3.10'
py: py310
- platform: ubuntu-latest
python-version: '3.11'
py: py311
- platform: macos-latest
python-version: 3.7
py: py37
- platform: macos-latest
python-version: '3.10'
py: py310
python-version: 3.9
py: py39
- platform: macos-latest
python-version: '3.11'
py: py311
- platform: windows-latest
python-version: 3.8
py: py38
- platform: windows-latest
python-version: '3.10'
py: py310
python-version: '3.11'
py: py311
steps:
- uses: actions/checkout@v3
- name: Set up Python v3
Expand All @@ -63,28 +69,6 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install Hatch
run: pip install -U hatch
- name: Get MD4C version
if: runner.os == 'macOS'
uses: oprypin/find-latest-tag@v1
id: md4c_version
with:
repository: mity/md4c
prefix: release-
- name: Fetch MD4C
uses: actions/checkout@v3
if: runner.os == 'macOS'
with:
repository: mity/md4c
ref: ${{steps.md4c-version.outputs.tag}}
path: md4c-lib
- name: Build MD4C
if: runner.os == 'macOS'
run: |
mkdir md4c-lib/build
cd md4c-lib/build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release
cmake --install .
- name: Run tests
run: hatch run +py=${{ matrix.py }} tests:all
- name: Coveralls
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- name: Set up Python v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
python-version: '3.10'
- name: Install dependencies
run: pip install -U hatch
- name: Build documentation
Expand All @@ -42,10 +42,10 @@ jobs:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- name: Set up Python v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
python-version: '3.10'
- name: Install dependencies
run: pip install -U hatch
- name: Build documentation
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ venv*/
*.tgz
docs/_build/
.vscode
/temp/
21 changes: 11 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Markdown files translation using PO files."
readme = "README.md"
license = "BSD-3-Clause"
authors = [{ name = "Álvaro Mondéjar Rubio", email = "mondejar1994@gmail.com" }]
requires-python = ">=3.7,<3.11"
requires-python = ">=3.7,<3.12"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Operating System :: OS Independent",
Expand All @@ -19,11 +19,12 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
keywords = ["markdown", "pofile", "translation", "html", "po", "i18n"]
dependencies = [
"polib~=1.1",
"pymd4c~=1.1.2",
"pymd4c~=1.3",
"importlib-metadata-argparse-version",
"importlib-metadata; python_version < '3.10'",
"contextlib-chdir~=1.0",
Expand Down Expand Up @@ -79,7 +80,7 @@ cov = [
]

[[tool.hatch.envs.tests.matrix]]
python = ["py37", "py38", "py39", "py310"]
python = ["py37", "py38", "py39", "py310", "py311"]

[tool.hatch.envs.docs]
python = "3.10"
Expand All @@ -103,13 +104,13 @@ targets = [{ file = "pyproject.toml" }, { file = "docs/pre-commit-hooks.rst" }]
[tool.project-config]
cache = "2 days"
style = [
"gh://mondeja/project-config-styles@v3/python/base.json5",
"gh://mondeja/project-config-styles@v3/python/single-quotes.json5",
"gh://mondeja/project-config-styles@v3/python/line-length-80.json5",
"gh://mondeja/project-config-styles@v3/python/tests.json5",
"gh://mondeja/project-config-styles@v3/python/sphinx.json5",
"gh://mondeja/project-config-styles@v3/python/readthedocs.json5",
"gh://mondeja/project-config-styles@v3/python/google-docstrings.json5"
"gh://mondeja/project-config-styles@v3.1/python/base.json5",
"gh://mondeja/project-config-styles@v3.1/python/single-quotes.json5",
"gh://mondeja/project-config-styles@v3.1/python/line-length-80.json5",
"gh://mondeja/project-config-styles@v3.1/python/tests.json5",
"gh://mondeja/project-config-styles@v3.1/python/sphinx.json5",
"gh://mondeja/project-config-styles@v3.1/python/readthedocs.json5",
"gh://mondeja/project-config-styles@v3.1/python/google-docstrings.json5"
]

[tool.pytest.ini_options]
Expand Down
10 changes: 5 additions & 5 deletions tests/test_integration/test_pre_commit_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_md2po_pre_commit_hook(tmp_dir, git_init, git_add_commit):
(
'.pre-commit-config.yaml', '''repos:
- repo: https://github.com/mondeja/mdpo
rev: master
rev: py311
hooks:
- id: md2po
files: ^README\\.md
Expand Down Expand Up @@ -70,7 +70,7 @@ def test_po2md_pre_commit_hook(tmp_dir, git_init, git_add_commit):
(
'.pre-commit-config.yaml', '''repos:
- repo: https://github.com/mondeja/mdpo
rev: master
rev: py311
hooks:
- id: po2md
files: ^README\\.md
Expand Down Expand Up @@ -131,7 +131,7 @@ def test_mdpo2html_pre_commit_hook(tmp_dir, git_init, git_add_commit):
(
'.pre-commit-config.yaml', '''repos:
- repo: https://github.com/mondeja/mdpo
rev: master
rev: py311
hooks:
- id: mdpo2html
files: ^README\\.html
Expand Down Expand Up @@ -191,7 +191,7 @@ def test_md2po2md_pre_commit_hook(tmp_dir, git_init, git_add_commit):
with tmp_dir({
'.pre-commit-config.yaml': '''repos:
- repo: https://github.com/mondeja/mdpo
rev: master
rev: py311
hooks:
- id: md2po2md
files: ^README\\.md
Expand Down Expand Up @@ -250,7 +250,7 @@ def test_md2po2md_pre_commit_hook(tmp_dir, git_init, git_add_commit):
git_add_commit('Second commit', cwd=filesdir)

proc = pre_commit_run_all_files(cwd=filesdir)
assert proc.returncode == 1
assert proc.returncode != 0
assert proc.stdout.decode('utf-8').splitlines()[-1] == (
'- files were modified by this hook'
)
Expand Down

0 comments on commit 06e7d39

Please sign in to comment.