nepdate-core 0.1.0b1__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) nepdate contributors
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.
@@ -0,0 +1,150 @@
1
+ Metadata-Version: 2.4
2
+ Name: nepdate-core
3
+ Version: 0.1.0b1
4
+ Summary: Bikram Sambat (Nepali calendar) for Python, dependency-free and typed
5
+ Author: NepDate contributors
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ License-File: shared/data/NOTICE
9
+ Classifier: Programming Language :: Python
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Programming Language :: Python :: Free Threading
16
+ Classifier: Typing :: Typed
17
+ Requires-Dist: tzdata ; sys_platform == 'win32'
18
+ Requires-Python: >=3.11
19
+ Description-Content-Type: text/markdown
20
+
21
+ <p align="center">
22
+ <img src="https://raw.githubusercontent.com/sanamhub/nepdate-python/main/docs/assets/nepdate-python-128.png" width="128" alt="NepDate for Python logo">
23
+ </p>
24
+
25
+ <h1 align="center">nepdate-python</h1>
26
+
27
+ <p align="center">
28
+ <a href="https://github.com/sanamhub/nepdate-python/actions/workflows/ci.yml"><img src="https://github.com/sanamhub/nepdate-python/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
29
+ <a href="https://pypi.org/project/nepdate-core/"><img src="https://img.shields.io/pypi/v/nepdate-core?include_prereleases&label=nepdate-core&logo=pypi&logoColor=white" alt="nepdate-core on PyPI"></a>
30
+ <a href="https://pypi.org/project/nepdate-patro/"><img src="https://img.shields.io/pypi/v/nepdate-patro?include_prereleases&label=nepdate-patro&logo=pypi&logoColor=white" alt="nepdate-patro on PyPI"></a>
31
+ <a href="https://pypi.org/project/nepdate-core/"><img src="https://img.shields.io/pypi/pyversions/nepdate-core?logo=python&logoColor=white" alt="Python versions"></a>
32
+ <a href="https://github.com/sanamhub/nepdate-python/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License: MIT"></a>
33
+ </p>
34
+
35
+ Bikram Sambat (Nepali calendar) dates, conversion, formatting and parsing for Python 3.11 and
36
+ newer. Part of the NepDate family: the shared data and spec live in the hub
37
+ [`sanamhub/nepdate`](https://github.com/sanamhub/nepdate); the C# original is
38
+ [NepDate](https://github.com/RajuPrasai/NepDate).
39
+
40
+ > **Status:** 0.1.0-beta.1 (`0.1.0b1` on PyPI), the first public pre-release. The API is listed in
41
+ > [docs/API.md](https://github.com/sanamhub/nepdate-python/blob/main/docs/API.md) and may still
42
+ > change before 0.1.0. Patro data (tithi, holidays, events) is informational, not an official
43
+ > calendar.
44
+
45
+ - Import `nepdate`. The core distribution is `nepdate-core`, because `nepdate` on PyPI belongs to
46
+ an unrelated project (ADR-0007).
47
+ - Tithi, public holidays and events are a separate distribution, `nepdate-patro` (import
48
+ `nepdate_patro`). The core has none of that data.
49
+ - Pure Python, zero runtime dependencies (except `tzdata` on Windows, for `today()`), typed
50
+ (`py.typed`), and works on free-threaded 3.14t.
51
+ - BS 1901-01-01 to 2199-12-30 (AD 1844-04-11 to 2143-04-15). Same results as C# NepDate and the
52
+ other ports, proved by the shared vectors.
53
+
54
+ ## Install
55
+
56
+ ```console
57
+ pip install --pre nepdate-core
58
+ ```
59
+
60
+ `--pre` is needed while only pre-releases exist; pin `nepdate-core==0.1.0b1` to stay on this one.
61
+
62
+ ## Quick start
63
+
64
+ ```python
65
+ >>> from nepdate import Lang, NepaliDate
66
+ >>> d = NepaliDate(2080, 5, 15)
67
+ >>> str(d)
68
+ '2080/05/15'
69
+ >>> d.to_date()
70
+ datetime.date(2023, 9, 1)
71
+ >>> d.long(weekday=True, lang=Lang.NE)
72
+ 'शुक्रवार, भदौ १५, २०८०'
73
+ >>> NepaliDate.parse("2080/05/15") == d
74
+ True
75
+
76
+ ```
77
+
78
+ Arithmetic stays on the BS calendar, so month lengths come from the shared data rather than from
79
+ the Gregorian calendar:
80
+
81
+ ```python
82
+ >>> d.add_days(1000)
83
+ NepaliDate(2083, 2, 14)
84
+ >>> d.add_months(13)
85
+ NepaliDate(2081, 6, 15)
86
+ >>> d.fiscal_year().label()
87
+ '2080/81'
88
+
89
+ ```
90
+
91
+ ## Patro: tithi, holidays and events
92
+
93
+ The core has no patro data. Install both distributions:
94
+
95
+ ```console
96
+ pip install --pre nepdate-core nepdate-patro
97
+ ```
98
+
99
+ ```python
100
+ >>> from nepdate import Lang, NepaliDate
101
+ >>> from nepdate_patro import coverage, info
102
+ >>> day = info(NepaliDate(2080, 5, 15))
103
+ >>> day.is_public_holiday
104
+ True
105
+ >>> day.tithi.label(Lang.EN)
106
+ 'Dwitiya'
107
+ >>> [event.label(Lang.EN) for event in day.events]
108
+ ['Saparu (Gaijatra) (Kathmandu Holiday)', 'Ropain Jatra']
109
+ >>> coverage().start
110
+ NepaliDate(2077, 1, 1)
111
+
112
+ ```
113
+
114
+ `info` never raises: a date outside the coverage returns one shared empty `CalendarInfo`. The
115
+ data currently covers BS 2077-01-01 to 2084-08-20.
116
+
117
+ ## API
118
+
119
+ The complete signatures, defaults and exceptions are in the
120
+ [API contract](https://github.com/sanamhub/nepdate-python/blob/main/docs/API.md).
121
+
122
+ | Module | Exported names |
123
+ |---|---|
124
+ | `nepdate` | `MIN`, `MAX`, `NepaliDate`, `Lang`, `Month`, `Weekday`, `Overflow`, `DateOrder`, `Separator`, `DateDiff`, `FiscalYear`, `Quarter`, `DateRange`, `ErrorKind`, `NepDateError`, `to_nepali_digits` |
125
+ | `nepdate_patro` | `Tithi`, `Event`, `CalendarInfo`, `info`, `coverage`, `public_holidays` |
126
+
127
+ ## Documentation
128
+
129
+ | Page | What it covers |
130
+ |---|---|
131
+ | [API](https://github.com/sanamhub/nepdate-python/blob/main/docs/API.md) | The complete public surface |
132
+ | [Benchmarks](https://github.com/sanamhub/nepdate-python/blob/main/docs/benchmarks.md) | B1 to B8 against the other Python packages and C# NepDate |
133
+ | [Competitors](https://github.com/sanamhub/nepdate-python/blob/main/docs/competitors.md) | The Python packages in the benchmark |
134
+ | [Mutation testing](https://github.com/sanamhub/nepdate-python/blob/main/docs/mutation.md) | How the test suite is checked against mutmut |
135
+ | [Fuzzing](https://github.com/sanamhub/nepdate-python/blob/main/docs/fuzzing.md) | How the parsers and formatter are fuzzed with atheris |
136
+ | [Release](https://github.com/sanamhub/nepdate-python/blob/main/docs/release.md) | The pre-tag matrix, freshness rule, rehearsal and post-publish check |
137
+ | [ADRs](https://github.com/sanamhub/nepdate-python/blob/main/docs/adr/README.md) | Why the design is what it is |
138
+ | [Changelog](https://github.com/sanamhub/nepdate-python/blob/main/CHANGELOG.md) | What changed in each version |
139
+ | [Contributing](https://github.com/sanamhub/nepdate-python/blob/main/CONTRIBUTING.md) | Setup, tests and commits |
140
+ | [Security](https://github.com/sanamhub/nepdate-python/blob/main/SECURITY.md) | Reporting a vulnerability |
141
+ | [Data error form](https://github.com/sanamhub/nepdate/issues/new/choose) | A wrong date, holiday or tithi, reported in the hub |
142
+ | [Spec](https://github.com/sanamhub/nepdate/tree/main/spec) | Behaviour and vectors, in the hub |
143
+ | [Other languages](https://github.com/sanamhub/nepdate#packages) | The same library for Rust, Go, TypeScript, Swift, Kotlin and C++ |
144
+
145
+ ## License
146
+
147
+ MIT ([LICENSE](https://github.com/sanamhub/nepdate-python/blob/main/LICENSE)). Calendar data from
148
+ NepDate by Raju Prasai and contributors, MIT
149
+ ([NOTICE](https://github.com/sanamhub/nepdate-python/blob/main/shared/data/NOTICE)). Not affiliated
150
+ with the Government of Nepal.
@@ -0,0 +1,130 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/sanamhub/nepdate-python/main/docs/assets/nepdate-python-128.png" width="128" alt="NepDate for Python logo">
3
+ </p>
4
+
5
+ <h1 align="center">nepdate-python</h1>
6
+
7
+ <p align="center">
8
+ <a href="https://github.com/sanamhub/nepdate-python/actions/workflows/ci.yml"><img src="https://github.com/sanamhub/nepdate-python/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
9
+ <a href="https://pypi.org/project/nepdate-core/"><img src="https://img.shields.io/pypi/v/nepdate-core?include_prereleases&label=nepdate-core&logo=pypi&logoColor=white" alt="nepdate-core on PyPI"></a>
10
+ <a href="https://pypi.org/project/nepdate-patro/"><img src="https://img.shields.io/pypi/v/nepdate-patro?include_prereleases&label=nepdate-patro&logo=pypi&logoColor=white" alt="nepdate-patro on PyPI"></a>
11
+ <a href="https://pypi.org/project/nepdate-core/"><img src="https://img.shields.io/pypi/pyversions/nepdate-core?logo=python&logoColor=white" alt="Python versions"></a>
12
+ <a href="https://github.com/sanamhub/nepdate-python/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License: MIT"></a>
13
+ </p>
14
+
15
+ Bikram Sambat (Nepali calendar) dates, conversion, formatting and parsing for Python 3.11 and
16
+ newer. Part of the NepDate family: the shared data and spec live in the hub
17
+ [`sanamhub/nepdate`](https://github.com/sanamhub/nepdate); the C# original is
18
+ [NepDate](https://github.com/RajuPrasai/NepDate).
19
+
20
+ > **Status:** 0.1.0-beta.1 (`0.1.0b1` on PyPI), the first public pre-release. The API is listed in
21
+ > [docs/API.md](https://github.com/sanamhub/nepdate-python/blob/main/docs/API.md) and may still
22
+ > change before 0.1.0. Patro data (tithi, holidays, events) is informational, not an official
23
+ > calendar.
24
+
25
+ - Import `nepdate`. The core distribution is `nepdate-core`, because `nepdate` on PyPI belongs to
26
+ an unrelated project (ADR-0007).
27
+ - Tithi, public holidays and events are a separate distribution, `nepdate-patro` (import
28
+ `nepdate_patro`). The core has none of that data.
29
+ - Pure Python, zero runtime dependencies (except `tzdata` on Windows, for `today()`), typed
30
+ (`py.typed`), and works on free-threaded 3.14t.
31
+ - BS 1901-01-01 to 2199-12-30 (AD 1844-04-11 to 2143-04-15). Same results as C# NepDate and the
32
+ other ports, proved by the shared vectors.
33
+
34
+ ## Install
35
+
36
+ ```console
37
+ pip install --pre nepdate-core
38
+ ```
39
+
40
+ `--pre` is needed while only pre-releases exist; pin `nepdate-core==0.1.0b1` to stay on this one.
41
+
42
+ ## Quick start
43
+
44
+ ```python
45
+ >>> from nepdate import Lang, NepaliDate
46
+ >>> d = NepaliDate(2080, 5, 15)
47
+ >>> str(d)
48
+ '2080/05/15'
49
+ >>> d.to_date()
50
+ datetime.date(2023, 9, 1)
51
+ >>> d.long(weekday=True, lang=Lang.NE)
52
+ 'शुक्रवार, भदौ १५, २०८०'
53
+ >>> NepaliDate.parse("2080/05/15") == d
54
+ True
55
+
56
+ ```
57
+
58
+ Arithmetic stays on the BS calendar, so month lengths come from the shared data rather than from
59
+ the Gregorian calendar:
60
+
61
+ ```python
62
+ >>> d.add_days(1000)
63
+ NepaliDate(2083, 2, 14)
64
+ >>> d.add_months(13)
65
+ NepaliDate(2081, 6, 15)
66
+ >>> d.fiscal_year().label()
67
+ '2080/81'
68
+
69
+ ```
70
+
71
+ ## Patro: tithi, holidays and events
72
+
73
+ The core has no patro data. Install both distributions:
74
+
75
+ ```console
76
+ pip install --pre nepdate-core nepdate-patro
77
+ ```
78
+
79
+ ```python
80
+ >>> from nepdate import Lang, NepaliDate
81
+ >>> from nepdate_patro import coverage, info
82
+ >>> day = info(NepaliDate(2080, 5, 15))
83
+ >>> day.is_public_holiday
84
+ True
85
+ >>> day.tithi.label(Lang.EN)
86
+ 'Dwitiya'
87
+ >>> [event.label(Lang.EN) for event in day.events]
88
+ ['Saparu (Gaijatra) (Kathmandu Holiday)', 'Ropain Jatra']
89
+ >>> coverage().start
90
+ NepaliDate(2077, 1, 1)
91
+
92
+ ```
93
+
94
+ `info` never raises: a date outside the coverage returns one shared empty `CalendarInfo`. The
95
+ data currently covers BS 2077-01-01 to 2084-08-20.
96
+
97
+ ## API
98
+
99
+ The complete signatures, defaults and exceptions are in the
100
+ [API contract](https://github.com/sanamhub/nepdate-python/blob/main/docs/API.md).
101
+
102
+ | Module | Exported names |
103
+ |---|---|
104
+ | `nepdate` | `MIN`, `MAX`, `NepaliDate`, `Lang`, `Month`, `Weekday`, `Overflow`, `DateOrder`, `Separator`, `DateDiff`, `FiscalYear`, `Quarter`, `DateRange`, `ErrorKind`, `NepDateError`, `to_nepali_digits` |
105
+ | `nepdate_patro` | `Tithi`, `Event`, `CalendarInfo`, `info`, `coverage`, `public_holidays` |
106
+
107
+ ## Documentation
108
+
109
+ | Page | What it covers |
110
+ |---|---|
111
+ | [API](https://github.com/sanamhub/nepdate-python/blob/main/docs/API.md) | The complete public surface |
112
+ | [Benchmarks](https://github.com/sanamhub/nepdate-python/blob/main/docs/benchmarks.md) | B1 to B8 against the other Python packages and C# NepDate |
113
+ | [Competitors](https://github.com/sanamhub/nepdate-python/blob/main/docs/competitors.md) | The Python packages in the benchmark |
114
+ | [Mutation testing](https://github.com/sanamhub/nepdate-python/blob/main/docs/mutation.md) | How the test suite is checked against mutmut |
115
+ | [Fuzzing](https://github.com/sanamhub/nepdate-python/blob/main/docs/fuzzing.md) | How the parsers and formatter are fuzzed with atheris |
116
+ | [Release](https://github.com/sanamhub/nepdate-python/blob/main/docs/release.md) | The pre-tag matrix, freshness rule, rehearsal and post-publish check |
117
+ | [ADRs](https://github.com/sanamhub/nepdate-python/blob/main/docs/adr/README.md) | Why the design is what it is |
118
+ | [Changelog](https://github.com/sanamhub/nepdate-python/blob/main/CHANGELOG.md) | What changed in each version |
119
+ | [Contributing](https://github.com/sanamhub/nepdate-python/blob/main/CONTRIBUTING.md) | Setup, tests and commits |
120
+ | [Security](https://github.com/sanamhub/nepdate-python/blob/main/SECURITY.md) | Reporting a vulnerability |
121
+ | [Data error form](https://github.com/sanamhub/nepdate/issues/new/choose) | A wrong date, holiday or tithi, reported in the hub |
122
+ | [Spec](https://github.com/sanamhub/nepdate/tree/main/spec) | Behaviour and vectors, in the hub |
123
+ | [Other languages](https://github.com/sanamhub/nepdate#packages) | The same library for Rust, Go, TypeScript, Swift, Kotlin and C++ |
124
+
125
+ ## License
126
+
127
+ MIT ([LICENSE](https://github.com/sanamhub/nepdate-python/blob/main/LICENSE)). Calendar data from
128
+ NepDate by Raju Prasai and contributors, MIT
129
+ ([NOTICE](https://github.com/sanamhub/nepdate-python/blob/main/shared/data/NOTICE)). Not affiliated
130
+ with the Government of Nepal.
@@ -0,0 +1,138 @@
1
+ [project]
2
+ name = "nepdate-core"
3
+ version = "0.1.0b1"
4
+ description = "Bikram Sambat (Nepali calendar) for Python, dependency-free and typed"
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "MIT"
8
+ license-files = [
9
+ "LICENSE",
10
+ "shared/data/NOTICE",
11
+ ]
12
+ classifiers = [
13
+ "Programming Language :: Python",
14
+ "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python :: 3.11",
16
+ "Programming Language :: Python :: 3.12",
17
+ "Programming Language :: Python :: 3.13",
18
+ "Programming Language :: Python :: 3.14",
19
+ "Programming Language :: Python :: Free Threading",
20
+ "Typing :: Typed",
21
+ ]
22
+ dependencies = ["tzdata; sys_platform == 'win32'"]
23
+
24
+ [[project.authors]]
25
+ name = "NepDate contributors"
26
+
27
+ [build-system]
28
+ requires = ["uv_build>=0.9.0,<0.13"]
29
+ build-backend = "uv_build"
30
+
31
+ [tool.uv.build-backend]
32
+ module-name = "nepdate"
33
+ source-include = ["shared/data/calendar/**"]
34
+
35
+ [tool.uv.workspace]
36
+ members = ["packages/nepdate-patro"]
37
+
38
+ [tool.mutmut]
39
+ source_paths = ["src"]
40
+ also_copy = [
41
+ "shared",
42
+ "packages/nepdate-patro/tests",
43
+ ]
44
+ do_not_mutate = [
45
+ "*_calendar.py",
46
+ "*_tables.py",
47
+ ]
48
+ pytest_add_cli_args = [
49
+ "-x",
50
+ "-q",
51
+ "--no-header",
52
+ "-p",
53
+ "no:cacheprovider",
54
+ "--import-mode=importlib",
55
+ "--ignore=tests/test_source_hygiene.py",
56
+ "--ignore=tests/test_lazy_imports.py",
57
+ "--ignore=packages/nepdate-patro/tests/test_import_separation.py",
58
+ ]
59
+ pytest_add_cli_args_test_selection = [
60
+ "tests",
61
+ "packages/nepdate-patro/tests",
62
+ ]
63
+
64
+ [tool.ruff]
65
+ line-length = 100
66
+ target-version = "py311"
67
+ src = [
68
+ "src",
69
+ "packages/nepdate-patro/src",
70
+ "scripts",
71
+ "tests",
72
+ ]
73
+ exclude = ["shared"]
74
+
75
+ [tool.ruff.lint]
76
+ select = [
77
+ "E",
78
+ "F",
79
+ "W",
80
+ "I",
81
+ "UP",
82
+ "B",
83
+ "SIM",
84
+ "RUF",
85
+ "PL",
86
+ "N",
87
+ "D",
88
+ ]
89
+
90
+ [tool.ruff.lint.pydocstyle]
91
+ convention = "google"
92
+
93
+ [tool.ruff.lint.per-file-ignores]
94
+ "tests/test_csharp_catalog.py" = ["E501"]
95
+ "packages/nepdate-patro/tests/test_csharp_catalog_patro.py" = [
96
+ "E501",
97
+ "PLR2004",
98
+ ]
99
+
100
+ [tool.ruff.format]
101
+ exclude = [
102
+ "src/nepdate/_calendar.py",
103
+ "packages/nepdate-patro/src/nepdate_patro/_tables.py",
104
+ ]
105
+
106
+ [tool.mypy]
107
+ strict = true
108
+
109
+ [tool.pytest.ini_options]
110
+ markers = ["slow: long-running tests, deselect with -m 'not slow'"]
111
+
112
+ [dependency-groups]
113
+ bench = [
114
+ "bikram==2.1.4",
115
+ "bikram-sambat==0.2.0",
116
+ "nepali==1.2.0",
117
+ "nepali-calendar-utils==3.1.0",
118
+ "nepali-datetime==1.0.8.5",
119
+ "nepkit==0.4.1 ; python_full_version >= '3.12'",
120
+ "npdatetime==0.2.10",
121
+ "psutil==7.2.2",
122
+ "pybsdate==0.3.2",
123
+ "pyperf==2.10.0",
124
+ ]
125
+ dev = [
126
+ "ruff>=0.8.0",
127
+ "mypy>=1.13.0",
128
+ "pytest>=8.3.0",
129
+ "pytest-cov>=5.0.0",
130
+ "hypothesis>=6.120.0",
131
+ ]
132
+ mutation = [
133
+ "hypothesis==6.170.1",
134
+ "mutmut==3.8.0",
135
+ "pytest-cov==7.1.0",
136
+ ]
137
+ fuzz = ["atheris==3.1.0 ; sys_platform == 'linux'"]
138
+ release = ["twine==7.0.0"]
@@ -0,0 +1,104 @@
1
+ [project]
2
+ name = "nepdate-core"
3
+ version = "0.1.0b1"
4
+ description = "Bikram Sambat (Nepali calendar) for Python, dependency-free and typed"
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "MIT"
8
+ license-files = ["LICENSE", "shared/data/NOTICE"]
9
+ authors = [{ name = "NepDate contributors" }]
10
+ classifiers = [
11
+ "Programming Language :: Python",
12
+ "Programming Language :: Python :: 3",
13
+ "Programming Language :: Python :: 3.11",
14
+ "Programming Language :: Python :: 3.12",
15
+ "Programming Language :: Python :: 3.13",
16
+ "Programming Language :: Python :: 3.14",
17
+ "Programming Language :: Python :: Free Threading",
18
+ "Typing :: Typed",
19
+ ]
20
+ dependencies = [
21
+ "tzdata; sys_platform == 'win32'",
22
+ ]
23
+
24
+ [build-system]
25
+ requires = ["uv_build>=0.9.0,<0.13"]
26
+ build-backend = "uv_build"
27
+
28
+ [tool.uv.build-backend]
29
+ module-name = "nepdate"
30
+ # The sdist carries the calendar source the generated tables come from. source-include does not
31
+ # affect the wheel, so the core wheel still has no shared data.
32
+ source-include = ["shared/data/calendar/**"]
33
+
34
+ [tool.mutmut]
35
+ source_paths = ["src"]
36
+ also_copy = ["shared", "packages/nepdate-patro/tests"]
37
+ do_not_mutate = ["*_calendar.py", "*_tables.py"]
38
+ pytest_add_cli_args = ["-x", "-q", "--no-header", "-p", "no:cacheprovider", "--import-mode=importlib", "--ignore=tests/test_source_hygiene.py", "--ignore=tests/test_lazy_imports.py", "--ignore=packages/nepdate-patro/tests/test_import_separation.py"]
39
+ pytest_add_cli_args_test_selection = ["tests", "packages/nepdate-patro/tests"]
40
+
41
+ [tool.uv.workspace]
42
+ members = ["packages/nepdate-patro"]
43
+
44
+ [dependency-groups]
45
+ bench = [
46
+ "bikram==2.1.4",
47
+ "bikram-sambat==0.2.0",
48
+ "nepali==1.2.0",
49
+ "nepali-calendar-utils==3.1.0",
50
+ "nepali-datetime==1.0.8.5",
51
+ "nepkit==0.4.1 ; python_full_version >= '3.12'",
52
+ "npdatetime==0.2.10",
53
+ "psutil==7.2.2",
54
+ "pybsdate==0.3.2",
55
+ "pyperf==2.10.0",
56
+ ]
57
+ dev = [
58
+ "ruff>=0.8.0",
59
+ "mypy>=1.13.0",
60
+ "pytest>=8.3.0",
61
+ "pytest-cov>=5.0.0",
62
+ "hypothesis>=6.120.0",
63
+ ]
64
+ mutation = [
65
+ "hypothesis==6.170.1",
66
+ "mutmut==3.8.0",
67
+ "pytest-cov==7.1.0",
68
+ ]
69
+ fuzz = [
70
+ "atheris==3.1.0 ; sys_platform == 'linux'",
71
+ ]
72
+ release = [
73
+ "twine==7.0.0",
74
+ ]
75
+
76
+ [tool.ruff]
77
+ line-length = 100
78
+ target-version = "py311"
79
+ src = ["src", "packages/nepdate-patro/src", "scripts", "tests"]
80
+ exclude = ["shared"]
81
+
82
+ [tool.ruff.lint]
83
+ select = ["E", "F", "W", "I", "UP", "B", "SIM", "RUF", "PL", "N", "D"]
84
+
85
+ [tool.ruff.lint.pydocstyle]
86
+ convention = "google"
87
+
88
+ [tool.ruff.format]
89
+ # Generated tables are written by scripts/codegen.py, not hand-formatted.
90
+ exclude = ["src/nepdate/_calendar.py", "packages/nepdate-patro/src/nepdate_patro/_tables.py"]
91
+
92
+ [tool.ruff.lint.per-file-ignores]
93
+ # Catalogue test function names are derived from the C# ids and cannot be shortened; the bodies
94
+ # assert the exact literal counts of the C# catalogue.
95
+ "tests/test_csharp_catalog.py" = ["E501"]
96
+ "packages/nepdate-patro/tests/test_csharp_catalog_patro.py" = ["E501", "PLR2004"]
97
+
98
+ [tool.mypy]
99
+ strict = true
100
+
101
+ [tool.pytest.ini_options]
102
+ markers = [
103
+ "slow: long-running tests, deselect with -m 'not slow'",
104
+ ]
@@ -0,0 +1,25 @@
1
+ The calendar data in this directory (data/calendar/, data/patro/) was extracted from
2
+ NepDate (https://github.com/RajuPrasai/NepDate, commit cb05cb65c7d3cb570c76992a8e83ed1e73213346)
3
+ by tools/extract_from_csharp.py on 2026-09-24, and is used under the MIT License:
4
+
5
+ MIT License
6
+
7
+ Copyright (c) 2023 NepDate and contributors
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.