Skip to content

Commit

Permalink
enh: add python 3.13, move to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-eschle committed Oct 31, 2024
1 parent 2d0032a commit 6dae29b
Show file tree
Hide file tree
Showing 21 changed files with 146 additions and 136 deletions.
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
25 changes: 9 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -16,13 +16,6 @@ repos:
- id: fix-byte-order-marker
- id: check-ast


- repo: https://github.com/myint/docformatter
rev: v1.7.5
hooks:
- id: docformatter
args: [ -r, --in-place, --wrap-descriptions, '120', --wrap-summaries, '120', -- ]

- repo: https://github.com/mattlqx/pre-commit-sign
rev: v1.2.0
hooks:
Expand All @@ -36,39 +29,39 @@ repos:


- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.19.0
hooks:
- id: pyupgrade
args: [ --py36-plus ]
args: [ --py37-plus ]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
rev: v2.7.0
hooks:
- id: setup-cfg-fmt

# Notebook formatting
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.5
rev: 1.8.7
hooks:
- id: nbqa-isort
additional_dependencies: [ isort ]

- id: nbqa-pyupgrade
additional_dependencies: [ pyupgrade ]
args: [ --py36-plus ]
args: [ --py37-plus ]

- repo: https://github.com/mgedmin/check-manifest
rev: '0.49'
rev: '0.50'
hooks:
- id: check-manifest
stages: [ manual ]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.7"
rev: "v0.7.1"
hooks:
- id: ruff
types_or: [ python, pyi, jupyter ]
args: [ --fix, --unsafe-fixes, --show-fixes , --line-length=120]
args: [ --fix, --unsafe-fixes, --show-fixes , --line-length=120 ]
# Run the formatter.
- id: ruff-format
types_or: [ python, pyi, jupyter ]
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

File renamed without changes
13 changes: 4 additions & 9 deletions docs/api/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@

# Manually added things

import sphinx_rtd_theme

import yamlloader

here = Path(__file__).resolve().parent
Expand All @@ -43,7 +41,7 @@

html_theme = "sphinx_rtd_theme"

html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand All @@ -60,7 +58,7 @@
"sphinx.ext.githubpages",
]

html_logo = here / "static/img/phynix_logo_medium.png"
html_logo = str(here / "_static/img/phynix_logo_medium.png")

# Napoleon settings (convert numpy/google docstrings to proper ReST
napoleon_google_docstring = False
Expand Down Expand Up @@ -131,8 +129,8 @@
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# Add any paths that contain custom _static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin _static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

Expand Down Expand Up @@ -228,6 +226,3 @@

# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"https://docs.python.org/": None}
6 changes: 3 additions & 3 deletions docs/api/yamlloader.ordereddict.dumpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ dumpers
=======

.. automodule:: yamlloader.ordereddict.dumpers
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions docs/api/yamlloader.ordereddict.loaders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ loaders
=======

.. automodule:: yamlloader.ordereddict.loaders
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
7 changes: 4 additions & 3 deletions docs/api/yamlloader.ordereddict.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ ordereddict
===========

.. automodule:: yamlloader.ordereddict
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

.. toctree::
:maxdepth: 4

yamlloader.ordereddict.dumpers
yamlloader.ordereddict.loaders
18 changes: 14 additions & 4 deletions docs/api/yamlloader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@ yamlloader package
==================

.. automodule:: yamlloader
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

Subpackages
-----------

.. toctree::
:maxdepth: 4

yamlloader.ordereddict
yamlloader.ordereddict

Submodules
----------

.. toctree::
:maxdepth: 4

yamlloader.settings
yamlloader.version
7 changes: 7 additions & 0 deletions docs/api/yamlloader.settings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
settings
========

.. automodule:: yamlloader.settings
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/api/yamlloader.version.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version
=======

.. automodule:: yamlloader.version
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/make_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MAKE_DOCS_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
popd > /dev/null

# generate the ReST files
sphinx-apidoc -o ${MAKE_DOCS_PATH}/api ${MAKE_DOCS_PATH}/../yamlloader -fMeT && \
sphinx-apidoc -o ${MAKE_DOCS_PATH}/api ${MAKE_DOCS_PATH}/../src/yamlloader -fMeT && \
python ${MAKE_DOCS_PATH}/api/tools/change_headline.py ${MAKE_DOCS_PATH}/api/yamlloader.* && \
make -C ${MAKE_DOCS_PATH}/api clean && make -C ${MAKE_DOCS_PATH}/api html -j4 && \
echo "Documentation successfully built!" || echo "FAILED to build Documentation"
127 changes: 90 additions & 37 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,65 @@
[build-system]
requires = [
"setuptools>=42",
# "setuptools_scm[toml]>=3.4",
# "setuptools_scm_git_archive",
"wheel"
"hatchling",
"hatch-vcs",
]

build-backend = "setuptools.build_meta"
build-backend = "hatchling.build"

[project]
name = "yamlloader"
description = "Ordered YAML loader and dumper for PyYAML."
readme = "README.rst"
authors = [
{ name = "Jonas Eschle", email = "[email protected]" },
{ name = "Johannes Lade", email = "[email protected]" },
]
maintainers = [
{ name = "Jonas Eschle", email = "[email protected]" },
]
keywords = [
"yaml",
"loader",
"dumper",
"ordered",
"dict",
"PyYAML",
]

dynamic = ["version"]
dependencies = [
"pyyaml",
]



license.file = "LICENSE"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Libraries",
"Topic :: Utilities",
]


[project.optional-dependencies]
test = ["pytest", "hypothesis"]
doc = ["sphinx", "sphinx-rtd-theme", "sphinx-autodoc-typehints", "sphinxcontrib-apidoc"]
dev = ['yamlloader[test,doc]']
[project.urls]
Homepage = "https://github.com/Phynix/yamlloader"
Documentation = "https://yamlloader.readthedocs.io/"

[tool.hatch]
version.source = "vcs"
build.hooks.vcs.version-file = "src/yamlloader/version.py"

[tool.ruff]
#src = ["src"]
Expand All @@ -19,41 +72,41 @@ exclude = [
]
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
"NPY", # NumPy specific rules
"PD", # pandas-vet
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
"NPY", # NumPy specific rules
"PD", # pandas-vet
]
ignore = [
"UP007", # type annotation upgrade, breaks pydantic for Python 3.9 (remove once above)
"PLR09", # Too many <...>
"PLR2004", # Magic value used in comparison
"ISC001", # Conflicts with formatter
"RET505", # This is sometimes wanted, protets against accidental intendation
"PD901", # "avoid using `df[...].values`" -> no, this is a very good name if there is only one df
"PD011", # "replace `df[...].values` with `df[...].to_numpy()`" -> not yet, it's not deprecated.
"UP007", # type annotation upgrade, breaks pydantic for Python 3.9 (remove once above)
"PLR09", # Too many <...>
"PLR2004", # Magic value used in comparison
"ISC001", # Conflicts with formatter
"RET505", # This is sometimes wanted, protets against accidental intendation
"PD901", # "avoid using `df[...].values`" -> no, this is a very good name if there is only one df
"PD011", # "replace `df[...].values` with `df[...].to_numpy()`" -> not yet, it's not deprecated.
# Prefer to have a single way to access the data if we don't care about whether it's a numpy array or not.
"PLW0603", # updating global variables with a function is bad, but we use it for
"PLW2901", # "for loop overwritten by assignment" -> we use this to update the loop variable
"PD013", # "melt over stack": df function, but triggers on tensors
"NPY002", # "Use rnd generator in numpy" -> we use np.random for some legacy stuff but do use the new one where we can
"PLW0603", # updating global variables with a function is bad, but we use it for
"PLW2901", # "for loop overwritten by assignment" -> we use this to update the loop variable
"PD013", # "melt over stack": df function, but triggers on tensors
"NPY002", # "Use rnd generator in numpy" -> we use np.random for some legacy stuff but do use the new one where we can

]
isort.required-imports = ["from __future__ import annotations"]
Expand Down
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

Loading

0 comments on commit 6dae29b

Please sign in to comment.