mirror of
https://github.com/pyscript/pyscript.git
synced 2026-02-22 14:01:31 -05:00
Import PyScript Version into Python Runtime (#958)
* Import current version as PyScript.__version__ and PyScript.version_info * Add integration, python unit tests * Mock pyscript.py with __mocks__/pyscript.js to make jest tests happy
This commit is contained in:
8
docs/reference/API/__version__.md
Normal file
8
docs/reference/API/__version__.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# `__version__`
|
||||
|
||||
`PyScript.__version__` is a `str` representing the current version of PyScript in a human-readable form. For a structured version more suitable to comparisons, and for details of what each part of the version number represents, see [`version_info`](version_info.md)
|
||||
|
||||
```shell
|
||||
>>> pyscript.__version__
|
||||
'2023.02.1.dev'
|
||||
```
|
||||
16
docs/reference/API/versIon_info.md
Normal file
16
docs/reference/API/versIon_info.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# `version_info`
|
||||
|
||||
`PyScript.version_info` is a `namedtuple` representing the current version of PyScript. It can be used to compare whether current version precedes or follows a desired version. For a human-readable version of the same info, see [`__version__`](__version__.md)
|
||||
|
||||
```sh
|
||||
>>> pyscript.version_info
|
||||
version_info(year=2023, month=2, minor=1, releaselevel='dev')
|
||||
```
|
||||
|
||||
## Version Fields
|
||||
| **parameter** | **CalVer equivalent field** | **example value** | **description** |
|
||||
|---------------|-------------------------|---------------|------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `year` | Full year (YYYY) | 2023 | The year of the release; when printed or represented as a string, always written with 4 digits |
|
||||
| `month` | Short Month (MM) | 2 | The month of the release; when printed or represented as a string, written with 1 or 2 digits as necessary |
|
||||
| `minor` | | 1 | The incremental number of the release for this month; when printed or represented as a string, written with 1 or two digits as necessary |
|
||||
| `releaselevel` | | 'dev' | A string representing the qualifications of this build. |
|
||||
Reference in New Issue
Block a user