prepare for publication

current
Síle Ekaterin Liszka 2024-01-13 21:27:13 -08:00
parent 91db9145be
commit 4b45acd0b6
Signed by: VulpineAmethyst
SSH Key Fingerprint: SHA256:VcHwQ6SUfi/p0Csfxe3SabX/TImWER0PhoJqkt+GlmE
8 changed files with 46 additions and 29 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ __pycache__/
build/
dist/
*.egg-info/
py-xbc-*/

1
MAINFEST.IN Normal file
View File

@ -0,0 +1 @@
include tests/*.xbc

View File

@ -68,5 +68,5 @@ foo { bar.fluff = 1 }
# Licence
`py-xbc` is published under the MIT license. See `LICENSE` for more
`py-xbc` is published under the MIT license. See `LICENSE.txt` for more
information.

View File

@ -1,6 +1,6 @@
[project]
name = 'py-xbc'
version = '0.1.0'
dynamic = ['version']
authors = [
{ name = 'Síle Ekaterin Liszka', email = 'sheila@vulpine.house' }
]
@ -35,6 +35,9 @@ Issues = 'https://gitea.treehouse.systems/VulpineAmethyst/py-xbc/issues'
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools.dynamic]
version = {attr = "xbc.version.version"}
[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",

37
setup.py Normal file
View File

@ -0,0 +1,37 @@
import pathlib
import sys
from setuptools import setup, find_packages
here = pathlib.Path(__file__).parent.resolve()
src = here / 'src'
sys.path.append(src.as_posix())
from xbc.version import version
long_description = (here / "README.md").read_text(encoding="utf-8")
setup(
name='py-xbc',
version=version,
description='A library for manipulating eXtra Boot Configuration (XBC) files',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://gitea.treehouse.systems/VulpineAmethyst/py-xbc',
author='Síle Ekaterin Liszka',
author_email='sheila@vulpine.house',
keywords='xbc, configuration, bootconfig',
package_dir={'': 'src'},
packages=find_packages(where='src'),
python_requires='>=3.7, <4',
install_requires=['pyparsing'],
extras_require={
'test': ['pytest'],
},
project_urls={
'Bug Reports': 'https://gitea.treehouse.systems/VulpineAmethyst/py-xbc/issues',
'Source': 'https://gitea.treehouse.systems/VulpineAmethyst/py-xbc',
}
)

View File

@ -19,33 +19,6 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
This module provides utilities for reading and writing files in the
Linux kernel's bootconfig format. This is not a strictly-conformant
implementation. In particular, this implementation does not restrict
key/block depths and makes no attempt whatsoever to ensure output is
under 32,767 bytes as mandated by the Linux kernel implementation.
XBC has three types of configuration:
- Keys are sequences of one or more characters in the range
`[a-zA-Z0-9_-]`, namespaced with dots. They can be specified without a
value, allowing their presence to be a boolean.
- Key/value pairs have a key component, an operator, and one or more
values. Values have three flavours:
- Bare values are sequences of one or more characters that are not in
the range `{}#=+:;,\\n'" `.
- Quoted strings are bounded by either single or double quotes, and
cannot contain the quote being bounded. Escaped quotes (`\\'` and
`\\"`) are not supported.
- Arrays are bare values or strings delimited by commas.
- Blocks have a key component and a sequence of keys, key/value pairs,
or blocks. Keys within blocks are not mapped separately; `a.a` is
identical to `a { a }`, for example.
XBC supports single-line comments using the pound sign (`#`).
"""
import re
from collections.abc import Mapping, Sequence
@ -68,6 +41,7 @@ from pyparsing import (
)
from .utils import normalise
from .version import version as __version__
class Node:
def __init__(self, *args, type=None):

1
src/xbc/version.py Normal file
View File

@ -0,0 +1 @@
version = '0.1.0'