dssatlab 0.1.0__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.
dssatlab-0.1.0/LICENSE ADDED
@@ -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,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,81 @@
1
+ # dssatlab
2
+
3
+ DSSATLab 0.1.0 provides basic environment diagnostics for Python users preparing
4
+ to work with DSSAT-CSM. It reports the operating system, machine architecture,
5
+ and Python version with zero runtime dependencies. Requires Python 3.10 or newer.
6
+
7
+ ## Install and use
8
+
9
+ ```bash
10
+ python -m pip install dssatlab
11
+ ```
12
+
13
+ ```python
14
+ import dssatlab
15
+
16
+ info = dssatlab.detect()
17
+ print(info)
18
+ print(info.os_name)
19
+ ```
20
+
21
+ Example output on Linux:
22
+
23
+ ```text
24
+ EnvironmentInfo(os_name='linux', architecture='x86_64', python_version='3.12.10')
25
+ linux
26
+ ```
27
+
28
+ `detect()` returns an immutable `EnvironmentInfo` dataclass:
29
+
30
+ | Field | Meaning |
31
+ | --- | --- |
32
+ | `os_name` | Lowercase OS name, such as `windows`, `linux`, or `darwin` (macOS). |
33
+ | `architecture` | Machine architecture as reported by Python, such as `AMD64`, `x86_64`, or `arm64`. |
34
+ | `python_version` | Version of the running Python interpreter. |
35
+
36
+ Unavailable OS or architecture values are reported as `unknown`. Importing the
37
+ package and calling `detect()` do not prompt, download, or change files.
38
+
39
+ This first release only reports the Python environment. DSSAT executable
40
+ discovery, installation, connection, Colab detection, and simulation support
41
+ are not implemented. No DSSAT software or data is bundled.
42
+
43
+ ## Source and development
44
+
45
+ ```text
46
+ src/dssatlab/
47
+ __init__.py # Public exports
48
+ core.py # EnvironmentInfo and detect()
49
+ tests/
50
+ test_detect.py # OS normalization and unknown-platform cases
51
+ pyproject.toml # Package metadata and development dependencies
52
+ .github/workflows/workflow.yml
53
+ README.md
54
+ LICENSE
55
+ .gitignore
56
+ ```
57
+
58
+ ```bash
59
+ python -m pip install -e '.[dev]'
60
+ python -m pytest
61
+ python -m build
62
+ python -m twine check dist/*
63
+ ```
64
+
65
+ ## Release
66
+
67
+ For a packaging check on GitHub, open **Actions > Publish to PyPI > Run workflow**
68
+ and choose `master`, leaving **Publish the package to PyPI** unchecked. This runs
69
+ tests, builds and validates the wheel and source archive, and saves them as an
70
+ artifact. To retry a failed upload using updated workflow configuration, run
71
+ the workflow with **Publish the package to PyPI** checked. This publishes the
72
+ version in the selected source after all checks pass; it does not create a tag.
73
+
74
+ To publish, update `version` in `pyproject.toml`, pass the tests and build checks,
75
+ and commit the source. Publish a GitHub release using a new matching tag on that
76
+ commit: version `0.1.0` uses tag `v0.1.0`. Publishing the release starts the PyPI
77
+ workflow; saving a draft or pushing a tag alone does not. Development versions
78
+ (`.dev`) are currently blocked by the workflow.
79
+
80
+ The PyPI Trusted Publisher uses owner `AbdelrahmanAmr3`, repository `dssatlab`,
81
+ workflow `workflow.yml`, and environment `pypi`. No API token is required.
@@ -0,0 +1,21 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "dssatlab"
7
+ version = "0.1.0"
8
+ description = "Basic environment diagnostics for DSSATLab users."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "BSD-3-Clause"
12
+ dependencies = []
13
+
14
+ [project.optional-dependencies]
15
+ dev = ["pytest>=8", "build>=1", "twine>=6"]
16
+
17
+ [project.urls]
18
+ Source = "https://github.com/AbdelrahmanAmr3/dssatlab"
19
+
20
+ [tool.setuptools.packages.find]
21
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ """Basic environment diagnostics for DSSATLab users."""
2
+
3
+ from .core import EnvironmentInfo, detect
4
+
5
+ __all__ = ["EnvironmentInfo", "detect"]
@@ -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,11 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/dssatlab/__init__.py
5
+ src/dssatlab/core.py
6
+ src/dssatlab.egg-info/PKG-INFO
7
+ src/dssatlab.egg-info/SOURCES.txt
8
+ src/dssatlab.egg-info/dependency_links.txt
9
+ src/dssatlab.egg-info/requires.txt
10
+ src/dssatlab.egg-info/top_level.txt
11
+ tests/test_detect.py
@@ -0,0 +1,5 @@
1
+
2
+ [dev]
3
+ pytest>=8
4
+ build>=1
5
+ twine>=6
@@ -0,0 +1 @@
1
+ dssatlab
@@ -0,0 +1,32 @@
1
+ """Check environment reporting without depending on the test runner's OS."""
2
+
3
+ import platform
4
+
5
+ import pytest
6
+
7
+ import dssatlab
8
+
9
+
10
+ @pytest.mark.parametrize(
11
+ "system, machine, expected_os, expected_architecture",
12
+ [
13
+ ("Windows", "AMD64", "windows", "AMD64"),
14
+ ("Windows", "ARM64", "windows", "ARM64"),
15
+ ("Linux", "x86_64", "linux", "x86_64"),
16
+ ("Darwin", "arm64", "darwin", "arm64"),
17
+ ("FreeBSD", "amd64", "freebsd", "amd64"),
18
+ ("", "", "unknown", "unknown"),
19
+ ],
20
+ )
21
+ def test_detect_normalizes_os_and_handles_unknown_platform(
22
+ monkeypatch, system, machine, expected_os, expected_architecture
23
+ ):
24
+ monkeypatch.setattr(platform, "system", lambda: system)
25
+ monkeypatch.setattr(platform, "machine", lambda: machine)
26
+ monkeypatch.setattr(platform, "python_version", lambda: "3.12.10")
27
+
28
+ info = dssatlab.detect()
29
+
30
+ assert info.os_name == expected_os
31
+ assert info.architecture == expected_architecture
32
+ assert info.python_version == "3.12.10"