Skip to content

Commit

Permalink
v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent-laporte-pro authored Apr 10, 2024
2 parents acad0ac + 671916d commit 5078ad9
Show file tree
Hide file tree
Showing 7 changed files with 330 additions and 24 deletions.
40 changes: 25 additions & 15 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Python package

on:
push:
branches: [ "main" ]
branches: [ "main", "dev" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "dev" ]

jobs:
build:
Expand All @@ -16,18 +16,28 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install hatch
- name: Test with pytest
run: |
hatch run test
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install hatch
- name: Test with pytest
run: hatch run test

- name: Check code style with hatch
run: hatch fmt --check

- name: Check typing with mypy
run: |
hatch run types:check
hatch run types:check-tests
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Antares Study Version Changelog
===============================

v0.1.1 (2024-04-10)
-------------------

### Fixes

* **model:** avoid deprecation warning about usage of `NotImplemented` in boolean context

### Tests

* replace [pytest-freezegun](https://pypi.org/project/pytest-freezegun/) lib
by [pytest-freezer](https://pypi.org/project/pytest-freezer/)

### Docs

* [README.md](README.md): update doc, fix typo, add a link to the change log

### Build

* create [CHANGELOG.md](CHANGELOG.md) and update the release date
* add [update_version.py](scripts/update_version.py) script to create or update the changelog

### CI

* add missing dependency [pytest-freezer](https://pypi.org/project/pytest-freezer/) required for type checking
* create the [GitHub workflows](.github/workflows/python-package.yml) for code style and typing check

v0.1.0 (2024-03-20)
-------------------

### Features

* First release of the project.

19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@
- [SolverVersion](#solverversion)
- [Pydantic model](#pydantic-model)
- [Development](#development)
- [Development tasks](#development-tasks)
- [Building the package](#building-the-package)
- [License](#license)
- [Changelog](CHANGELOG.md)

## Overview

The `antares-study-version` package defines `StudyVersion` and `SolverVersion` classes to manage version numbers.
It can be used to manage the version of a study, but also the version
of [Antares Solver](https://github.com/AntaresSimulatorTeam/Antares_Simulator).
It supports the [semver](https://semver.org/) format ("major.minor.patch") and the integer format
(major*100 + minor*10 + patch), which is specific to Antares.
(major×100 + minor×10 + patch), which is specific to Antares.

This module harmonizes the management of versions in Antares:

Expand All @@ -31,7 +34,7 @@ This module harmonizes the management of versions in Antares:

In the data of a study and in the programs, we encounter several version formats:

- dotted string (ex. "8.7" or "8.7.2"),
- dotted string (ex. `"8.7"` or `"8.7.2"`),
- compact string (ex. `"870"`),
- integer (ex. `870`).
- tuples or lists (ex. `(8, 7)` or `[8, 7, 2]`).
Expand All @@ -42,8 +45,8 @@ For instance, since
of Antares Solver, versions are stored as dotted strings;
the compact format is now obsolete (backward compatibility is ensured for versions prior to 9.0);

For instance, the `study.antares` configuration file now uses the "X.Y" format for the study version instead of the "
XYZ" format.
For instance, the `study.antares` configuration file now uses the "X.Y" format for the study version instead
of the "XYZ" format.

```ini
[antares]
Expand Down Expand Up @@ -238,14 +241,20 @@ hatch fmt

> See [hatch fmt](https://hatch.pypa.io/latest/cli/reference/#hatch-fmt) documentation
➢ To run the tests, run:
➢ To run the tests on the current Python version, run:

```shell
hatch run test
```

> See [hatch run](https://hatch.pypa.io/latest/cli/reference/#hatch-run) documentation
➢ To run the tests on Python 3.12, for example, run:

```shell
hatch run all.py3.12:test
```

➢ To generate the test coverage report, run:

```shell
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies = [
"coverage[toml]>=6.5",
"pytest<8",
"pydantic<2",
"pytest-freezegun<0.5",
"pytest-freezer<0.5",
]

[tool.hatch.envs.default.scripts]
Expand All @@ -67,6 +67,7 @@ python = ["3.8", "3.9", "3.10", "3.11", "3.12"]
dependencies = [
"pytest<8",
"pydantic<2",
"pytest-freezer<0.5",
"mypy>=1.0.0",
]
[tool.hatch.envs.types.scripts]
Expand Down
Loading

0 comments on commit 5078ad9

Please sign in to comment.