Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.12 #285

Merged
merged 3 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Tests
on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
- '*.rst'
- "docs/**"
- "*.md"
- "*.rst"
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
- '*.rst'
- "docs/**"
- "*.md"
- "*.rst"
jobs:
tests:
name: ${{ matrix.name }}
Expand All @@ -18,14 +18,15 @@ jobs:
fail-fast: false
matrix:
include:
- {name: Linux, python: '3.11', os: ubuntu-latest, tox: py311}
- {name: Windows, python: '3.11', os: windows-latest, tox: py311}
- {name: Mac, python: '3.11', os: macos-latest, tox: py311}
- {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}
- {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
- {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
- {name: 'PyPy3', python: 'pypy-3.9', os: ubuntu-latest, tox: pypy3}
- { name: Linux, python: "3.12", os: ubuntu-latest, tox: py312 }
- { name: Windows, python: "3.12", os: windows-latest, tox: py312 }
- { name: Mac, python: "3.12", os: macos-latest, tox: py312 }
- { name: "3.11", python: "3.11", os: ubuntu-latest, tox: py311 }
- { name: "3.10", python: "3.10", os: ubuntu-latest, tox: py310 }
- { name: "3.9", python: "3.9", os: ubuntu-latest, tox: py39 }
- { name: "3.8", python: "3.8", os: ubuntu-latest, tox: py38 }
- { name: "3.7", python: "3.7", os: ubuntu-latest, tox: py37 }
- { name: "PyPy3", python: "pypy-3.9", os: ubuntu-latest, tox: pypy3 }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
Expand All @@ -52,4 +53,3 @@ jobs:
fail_ci_if_error: true
files: ./.tox/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}

2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include LICENSE CHANGELOG.md tox.ini requirements.txt requirements-rtd.txt .coveragerc Makefile pytest.ini .tox-coveragerc
exclude TODO.md codecov.yml .readthedocs.yaml
exclude TODO.md codecov.yml .readthedocs.yaml requirements.in
global-exclude flycheck_*

graft glom/test/data
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# -- Project information -----------------------------------------------------

project = u'glom'
copyright = u'2023, Mahmoud Hashemi'
copyright = u'2024, Mahmoud Hashemi'
author = u'Mahmoud Hashemi'

# The short X.Y version
Expand Down
1 change: 0 additions & 1 deletion glom/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from glom.core import (glom,
Fill,
Auto,
Expand Down
1 change: 0 additions & 1 deletion glom/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from glom.cli import console_main

if __name__ == '__main__':
Expand Down
17 changes: 8 additions & 9 deletions glom/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"""


from __future__ import print_function

import os
import ast
Expand Down Expand Up @@ -65,7 +64,7 @@ def glom_cli(target, spec, indent, debug, inspect):
try:
result = glom.glom(target, spec)
except GlomError as ge:
print('%s: %s' % (ge.__class__.__name__, ge))
print(f'{ge.__class__.__name__}: {ge}')
return 1

if not indent:
Expand Down Expand Up @@ -170,10 +169,10 @@ def mw_get_target(next_, posargs_, target_file, target_format, spec_file, spec_f
raise UsageError('expected spec file or spec argument, not both')
elif spec_file:
try:
with open(spec_file, 'r') as f:
with open(spec_file) as f:
spec_text = f.read()
except IOError as ose:
raise UsageError('could not read spec file %r, got: %s' % (spec_file, ose))
except OSError as ose:
raise UsageError(f'could not read spec file {spec_file!r}, got: {ose}')

if not spec_text:
spec = Path()
Expand All @@ -195,9 +194,9 @@ def mw_get_target(next_, posargs_, target_file, target_format, spec_file, spec_f
target_text = sys.stdin.read()
elif target_file:
try:
target_text = open(target_file, 'r').read()
except IOError as ose:
raise UsageError('could not read target file %r, got: %s' % (target_file, ose))
target_text = open(target_file).read()
except OSError as ose:
raise UsageError(f'could not read target file {target_file!r}, got: {ose}')
elif not target_text and not isatty(sys.stdin):
target_text = sys.stdin.read()

Expand All @@ -218,7 +217,7 @@ def _from_glom_import_star():

def _eval_python_full_spec(py_text):
name = '__cli_glom_spec__'
code_str = '%s = %s' % (name, py_text)
code_str = f'{name} = {py_text}'
env = _from_glom_import_star()
spec = _compile_code(code_str, name=name, env=env)
return spec
Expand Down
Loading
Loading