dssatlab 0.1.0__py3-none-any.whl
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.
dssatlab/__init__.py
ADDED
dssatlab/core.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""Report the local Python environment without changing it."""
|
|
2
|
+
|
|
3
|
+
import platform
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass(frozen=True)
|
|
8
|
+
class EnvironmentInfo:
|
|
9
|
+
"""Operating system, machine architecture, and Python interpreter version."""
|
|
10
|
+
|
|
11
|
+
os_name: str
|
|
12
|
+
architecture: str
|
|
13
|
+
python_version: str
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def detect() -> EnvironmentInfo:
|
|
17
|
+
"""Return environment details without prompts, downloads, or file changes.
|
|
18
|
+
|
|
19
|
+
OS names are lowercase (macOS is ``darwin``). Architecture uses the
|
|
20
|
+
platform's original spelling. Unavailable OS or architecture is ``unknown``.
|
|
21
|
+
This function does not search for or validate a DSSAT installation.
|
|
22
|
+
"""
|
|
23
|
+
return EnvironmentInfo(
|
|
24
|
+
os_name=platform.system().lower() or "unknown",
|
|
25
|
+
architecture=platform.machine() or "unknown",
|
|
26
|
+
python_version=platform.python_version(),
|
|
27
|
+
)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dssatlab
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Basic environment diagnostics for DSSATLab users.
|
|
5
|
+
License-Expression: BSD-3-Clause
|
|
6
|
+
Project-URL: Source, https://github.com/AbdelrahmanAmr3/dssatlab
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Provides-Extra: dev
|
|
11
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
12
|
+
Requires-Dist: build>=1; extra == "dev"
|
|
13
|
+
Requires-Dist: twine>=6; extra == "dev"
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# dssatlab
|
|
17
|
+
|
|
18
|
+
DSSATLab 0.1.0 provides basic environment diagnostics for Python users preparing
|
|
19
|
+
to work with DSSAT-CSM. It reports the operating system, machine architecture,
|
|
20
|
+
and Python version with zero runtime dependencies. Requires Python 3.10 or newer.
|
|
21
|
+
|
|
22
|
+
## Install and use
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
python -m pip install dssatlab
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
import dssatlab
|
|
30
|
+
|
|
31
|
+
info = dssatlab.detect()
|
|
32
|
+
print(info)
|
|
33
|
+
print(info.os_name)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Example output on Linux:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
EnvironmentInfo(os_name='linux', architecture='x86_64', python_version='3.12.10')
|
|
40
|
+
linux
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`detect()` returns an immutable `EnvironmentInfo` dataclass:
|
|
44
|
+
|
|
45
|
+
| Field | Meaning |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| `os_name` | Lowercase OS name, such as `windows`, `linux`, or `darwin` (macOS). |
|
|
48
|
+
| `architecture` | Machine architecture as reported by Python, such as `AMD64`, `x86_64`, or `arm64`. |
|
|
49
|
+
| `python_version` | Version of the running Python interpreter. |
|
|
50
|
+
|
|
51
|
+
Unavailable OS or architecture values are reported as `unknown`. Importing the
|
|
52
|
+
package and calling `detect()` do not prompt, download, or change files.
|
|
53
|
+
|
|
54
|
+
This first release only reports the Python environment. DSSAT executable
|
|
55
|
+
discovery, installation, connection, Colab detection, and simulation support
|
|
56
|
+
are not implemented. No DSSAT software or data is bundled.
|
|
57
|
+
|
|
58
|
+
## Source and development
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
src/dssatlab/
|
|
62
|
+
__init__.py # Public exports
|
|
63
|
+
core.py # EnvironmentInfo and detect()
|
|
64
|
+
tests/
|
|
65
|
+
test_detect.py # OS normalization and unknown-platform cases
|
|
66
|
+
pyproject.toml # Package metadata and development dependencies
|
|
67
|
+
.github/workflows/workflow.yml
|
|
68
|
+
README.md
|
|
69
|
+
LICENSE
|
|
70
|
+
.gitignore
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
python -m pip install -e '.[dev]'
|
|
75
|
+
python -m pytest
|
|
76
|
+
python -m build
|
|
77
|
+
python -m twine check dist/*
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Release
|
|
81
|
+
|
|
82
|
+
For a packaging check on GitHub, open **Actions > Publish to PyPI > Run workflow**
|
|
83
|
+
and choose `master`, leaving **Publish the package to PyPI** unchecked. This runs
|
|
84
|
+
tests, builds and validates the wheel and source archive, and saves them as an
|
|
85
|
+
artifact. To retry a failed upload using updated workflow configuration, run
|
|
86
|
+
the workflow with **Publish the package to PyPI** checked. This publishes the
|
|
87
|
+
version in the selected source after all checks pass; it does not create a tag.
|
|
88
|
+
|
|
89
|
+
To publish, update `version` in `pyproject.toml`, pass the tests and build checks,
|
|
90
|
+
and commit the source. Publish a GitHub release using a new matching tag on that
|
|
91
|
+
commit: version `0.1.0` uses tag `v0.1.0`. Publishing the release starts the PyPI
|
|
92
|
+
workflow; saving a draft or pushing a tag alone does not. Development versions
|
|
93
|
+
(`.dev`) are currently blocked by the workflow.
|
|
94
|
+
|
|
95
|
+
The PyPI Trusted Publisher uses owner `AbdelrahmanAmr3`, repository `dssatlab`,
|
|
96
|
+
workflow `workflow.yml`, and environment `pypi`. No API token is required.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
dssatlab/__init__.py,sha256=PU2uoBHGTRQBF0PjwUkAMkfZOFasRm6Rp5tFAVnDjXQ,140
|
|
2
|
+
dssatlab/core.py,sha256=CnaF7ClIl8ymiwTJe3ALUMLJQXxBtQpcKG-W3huSjd4,851
|
|
3
|
+
dssatlab-0.1.0.dist-info/licenses/LICENSE,sha256=rUoW5CWhi12QTSH_D1JaySWCZ-Fhjz3VVXBeOFkVugw,1529
|
|
4
|
+
dssatlab-0.1.0.dist-info/METADATA,sha256=DyB3roN-kBBk2y8U8IHcQIWoRhj4kRxkK0Z-p-NvuGg,3184
|
|
5
|
+
dssatlab-0.1.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
6
|
+
dssatlab-0.1.0.dist-info/top_level.txt,sha256=-Lwu1FHivCSzwZn_d11CRDYZXGnQF73irjNaqWDbb7o,9
|
|
7
|
+
dssatlab-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, DSSATLab contributors
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dssatlab
|