settingsclass 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. settingsclass-0.1.4/.github/workflows/python-publish.yml +39 -0
  2. settingsclass-0.1.4/.github/workflows/tests.yml +47 -0
  3. settingsclass-0.1.4/.gitignore +171 -0
  4. settingsclass-0.1.4/LICENSE +21 -0
  5. settingsclass-0.1.4/PKG-INFO +539 -0
  6. settingsclass-0.1.4/README.md +524 -0
  7. settingsclass-0.1.4/README_JA.md +559 -0
  8. settingsclass-0.1.4/demo.py +181 -0
  9. settingsclass-0.1.4/demo_ja.py +184 -0
  10. settingsclass-0.1.4/pyproject.toml +28 -0
  11. settingsclass-0.1.4/requirements-dev.txt +5 -0
  12. settingsclass-0.1.4/requirements.txt +2 -0
  13. settingsclass-0.1.4/setup.cfg +4 -0
  14. settingsclass-0.1.4/src/settingsclass/__init__.py +21 -0
  15. settingsclass-0.1.4/src/settingsclass/loc/settings.csv +36 -0
  16. settingsclass-0.1.4/src/settingsclass/localizer.py +216 -0
  17. settingsclass-0.1.4/src/settingsclass/settingsclass.py +1012 -0
  18. settingsclass-0.1.4/src/settingsclass.egg-info/PKG-INFO +539 -0
  19. settingsclass-0.1.4/src/settingsclass.egg-info/SOURCES.txt +43 -0
  20. settingsclass-0.1.4/src/settingsclass.egg-info/dependency_links.txt +1 -0
  21. settingsclass-0.1.4/src/settingsclass.egg-info/requires.txt +2 -0
  22. settingsclass-0.1.4/src/settingsclass.egg-info/top_level.txt +1 -0
  23. settingsclass-0.1.4/tests/__init__.py +0 -0
  24. settingsclass-0.1.4/tests/input/loc/test_strings_correct.csv +7 -0
  25. settingsclass-0.1.4/tests/input/loc/test_strings_duplicate_key.csv +5 -0
  26. settingsclass-0.1.4/tests/input/loc/test_strings_error_few.csv +4 -0
  27. settingsclass-0.1.4/tests/input/loc/test_strings_error_many.csv +4 -0
  28. settingsclass-0.1.4/tests/input/loc/test_strings_error_nostr.csv +3 -0
  29. settingsclass-0.1.4/tests/input/loc/test_strings_half_specified.csv +3 -0
  30. settingsclass-0.1.4/tests/input/loc/test_strings_warning.csv +8 -0
  31. settingsclass-0.1.4/tests/input/settingsclass/config.ini/config.ini +16 -0
  32. settingsclass-0.1.4/tests/input/settingsclass/config_bad_type.ini +16 -0
  33. settingsclass-0.1.4/tests/input/settingsclass/config_confusing_types.ini +16 -0
  34. settingsclass-0.1.4/tests/input/settingsclass/config_duplicate_param.ini +17 -0
  35. settingsclass-0.1.4/tests/input/settingsclass/config_duplicate_section.ini +21 -0
  36. settingsclass-0.1.4/tests/input/settingsclass/config_extra_parts.ini +21 -0
  37. settingsclass-0.1.4/tests/input/settingsclass/config_generated_good.ini +14 -0
  38. settingsclass-0.1.4/tests/input/settingsclass/config_generated_good_half_enc.ini +14 -0
  39. settingsclass-0.1.4/tests/input/settingsclass/config_good_case_var.ini +16 -0
  40. settingsclass-0.1.4/tests/input/settingsclass/config_missing_section.ini +8 -0
  41. settingsclass-0.1.4/tests/input/settingsclass/config_modified.ini +16 -0
  42. settingsclass-0.1.4/tests/reports/coverage-badge.svg +1 -0
  43. settingsclass-0.1.4/tests/test_localization.py +446 -0
  44. settingsclass-0.1.4/tests/test_localization_fail_cases.py +99 -0
  45. settingsclass-0.1.4/tests/test_settings.py +908 -0
@@ -0,0 +1,39 @@
1
+ # This workflow will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ deploy:
20
+
21
+ runs-on: ubuntu-latest
22
+
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - name: Set up Python
26
+ uses: actions/setup-python@v3
27
+ with:
28
+ python-version: '3.x'
29
+ - name: Install dependencies
30
+ run: |
31
+ python -m pip install --upgrade pip
32
+ pip install build
33
+ - name: Build package
34
+ run: python -m build
35
+ - name: Publish package
36
+ uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37
+ with:
38
+ user: __token__
39
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,47 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a single version of Python
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Python Tests
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ build:
17
+
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - uses: actions/checkout@v3
22
+ - name: Set up Python 3.11
23
+ uses: actions/setup-python@v3
24
+ with:
25
+ python-version: "3.11"
26
+ - name: Install dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install flake8 pytest
30
+ pip install -r requirements-dev.txt
31
+ pip install -r requirements.txt
32
+ pip install -e .
33
+ - name: Lint with flake8
34
+ run: |
35
+ # stop the build if there are Python syntax errors or undefined names
36
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
37
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
38
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
39
+ - name: Test with pytest
40
+ run: |
41
+ coverage run -m pytest
42
+ - name: Generate Badge
43
+ run: |
44
+ coverage report
45
+ coverage xml -o tests/reports/coverage.xml
46
+ coverage html -d tests/reports/www
47
+ genbadge coverage -i tests/reports/coverage.xml -o tests/reports/coverage-badge.svg
@@ -0,0 +1,171 @@
1
+ # Project Files
2
+
3
+ logs/
4
+ tests/output
5
+ config.ini
6
+ config_bk.ini
7
+ web2.ini
8
+ webconfig.ini
9
+
10
+ # Byte-compiled / optimized / DLL files
11
+ __pycache__/
12
+ *.py[cod]
13
+ *$py.class
14
+
15
+ # C extensions
16
+ *.so
17
+
18
+ # Distribution / packaging
19
+ .Python
20
+ build/
21
+ develop-eggs/
22
+ dist/
23
+ downloads/
24
+ eggs/
25
+ .eggs/
26
+ lib/
27
+ lib64/
28
+ parts/
29
+ sdist/
30
+ var/
31
+ wheels/
32
+ share/python-wheels/
33
+ *.egg-info/
34
+ .installed.cfg
35
+ *.egg
36
+ MANIFEST
37
+
38
+ # PyInstaller
39
+ # Usually these files are written by a python script from a template
40
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
41
+ *.manifest
42
+ *.spec
43
+
44
+ # Installer logs
45
+ pip-log.txt
46
+ pip-delete-this-directory.txt
47
+
48
+ # Unit test / coverage reports
49
+ htmlcov/
50
+ .tox/
51
+ .nox/
52
+ .coverage
53
+ .coverage.*
54
+ .cache
55
+ nosetests.xml
56
+ coverage.xml
57
+ *.cover
58
+ *.py,cover
59
+ .hypothesis/
60
+ .pytest_cache/
61
+ cover/
62
+
63
+ # Translations
64
+ *.mo
65
+ *.pot
66
+
67
+ # Django stuff:
68
+ *.log
69
+ local_settings.py
70
+ db.sqlite3
71
+ db.sqlite3-journal
72
+
73
+ # Flask stuff:
74
+ instance/
75
+ .webassets-cache
76
+
77
+ # Scrapy stuff:
78
+ .scrapy
79
+
80
+ # Sphinx documentation
81
+ docs/_build/
82
+
83
+ # PyBuilder
84
+ .pybuilder/
85
+ target/
86
+
87
+ # Jupyter Notebook
88
+ .ipynb_checkpoints
89
+
90
+ # IPython
91
+ profile_default/
92
+ ipython_config.py
93
+
94
+ # pyenv
95
+ # For a library or package, you might want to ignore these files since the code is
96
+ # intended to run in multiple environments; otherwise, check them in:
97
+ # .python-version
98
+
99
+ # pipenv
100
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
101
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
102
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
103
+ # install all needed dependencies.
104
+ #Pipfile.lock
105
+
106
+ # poetry
107
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
108
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
109
+ # commonly ignored for libraries.
110
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
111
+ #poetry.lock
112
+
113
+ # pdm
114
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
115
+ #pdm.lock
116
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
117
+ # in version control.
118
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
119
+ .pdm.toml
120
+ .pdm-python
121
+ .pdm-build/
122
+
123
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
124
+ __pypackages__/
125
+
126
+ # Celery stuff
127
+ celerybeat-schedule
128
+ celerybeat.pid
129
+
130
+ # SageMath parsed files
131
+ *.sage.py
132
+
133
+ # Environments
134
+ .env*
135
+ .venv*
136
+ env/
137
+ venv/
138
+ ENV/
139
+ env.bak/
140
+ venv.bak/
141
+
142
+ # Spyder project settings
143
+ .spyderproject
144
+ .spyproject
145
+
146
+ # Rope project settings
147
+ .ropeproject
148
+
149
+ # mkdocs documentation
150
+ /site
151
+
152
+ # mypy
153
+ .mypy_cache/
154
+ .dmypy.json
155
+ dmypy.json
156
+
157
+ # Pyre type checker
158
+ .pyre/
159
+
160
+ # pytype static type analyzer
161
+ .pytype/
162
+
163
+ # Cython debug symbols
164
+ cython_debug/
165
+
166
+ # PyCharm
167
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
168
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
169
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
170
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
171
+ #.idea/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 id-ai-labo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.