Skip to content

Commit

Permalink
Extract common Python
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <[email protected]>
  • Loading branch information
gaborbernat committed Oct 18, 2024
1 parent 0f7af98 commit 0c36c6d
Show file tree
Hide file tree
Showing 25 changed files with 893 additions and 618 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/common/target
/target
/pyproject-fmt/.tox
/pyproject-fmt/dist
/dist
.tox
target
dist
__pycache__
_lib.abi3.*
4 changes: 2 additions & 2 deletions common/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# toml-fmt common
# toml-fmt-common

Contains code common to all formatters.
Contains Rust code common to all formatters under the `toml-fmt` umbrella.

[![Test common](https://github.com/tox-dev/toml-fmt/actions/workflows/common.yaml/badge.svg)](https://github.com/tox-dev/toml-fmt/actions/workflows/common.yaml)
Empty file added py-common/CHANGELOG.md
Empty file.
18 changes: 18 additions & 0 deletions py-common/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5 changes: 5 additions & 0 deletions py-common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# toml-fmt-common

Contains Python code common to all formatters under the `toml-fmt` umbrella.

[![Test common](https://github.com/tox-dev/toml-fmt/actions/workflows/py-common.yaml/badge.svg)](https://github.com/tox-dev/toml-fmt/actions/workflows/py-common.yaml)
97 changes: 97 additions & 0 deletions py-common/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"hatchling>=1.25",
]

[project]
name = "toml-fmt-common"
version = "1.0.0"
description = "Common logic to the TOML formatter."
readme = "README.md"
license = "MIT"
maintainers = [
{ name = "Bernát Gábor", email = "[email protected]" },
]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Internet",
"Topic :: Software Development :: Libraries",
"Topic :: System",
]
dependencies = [
"tomli>=2.0.2; python_version<'3.11'",
]
urls."Bug Tracker" = "https://github.com/tox-dev/toml-fmt/issues"
urls."Changelog" = "https://github.com/tox-dev/toml-fmt/blob/main/py-common/CHANGELOG.md"
urls.Documentation = "https://github.com/tox-dev/toml-fmt/"
urls."Source Code" = "https://github.com/tox-dev/toml-fmt"

[tool.ruff]
extend = "../pyproject.toml"
lint.isort = { known-first-party = [
"toml_fmt_common",
"tests",
], required-imports = [
"from __future__ import annotations",
] }

[tool.pyproject-fmt]
max_supported_python = "3.13"

[tool.coverage]
html.show_contexts = true
html.skip_covered = false
paths.source = [
"src",
".tox/*/lib/*/site-packages",
".tox\\*\\Lib\\site-packages",
"**/src",
"**\\src",
]
paths.other = [
".",
"*/toml_fmt_common",
"*\\toml_fmt_common",
]
report.fail_under = 100
run.parallel = true
run.plugins = [
"covdefaults",
]

[tool.mypy]
show_error_codes = true
strict = true

[dependency-groups]
dev = [
{ include-group = "test" },
{ include-group = "type" },
]
pkg-meta = [
"check-wheel-contents>=0.6",
"twine>=5.1.1",
"uv>=0.4.17",
]
test = [
"covdefaults>=2.3",
"pytest>=8.3.2",
"pytest-cov>=5",
"pytest-mock>=3.14",
]
type = [
"mypy==1.11.2",
{ include-group = "test" },
]
Loading

0 comments on commit 0c36c6d

Please sign in to comment.