Skip to content

Commit 9e20336

Browse files
committed
Add python 3.10 support and drop python 3.6 support
* Add python 3.10 support (add to test matrix) * Drop python 3.6 support * Use tomli instead of toml for toml support * Update dependency range and dev dependencies
1 parent f1fed47 commit 9e20336

File tree

7 files changed

+466
-361
lines changed

7 files changed

+466
-361
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python-version: [3.6, 3.7, 3.8, 3.9]
15+
python-version: ["3.7", "3.8", "3.9", "3.10"]
1616

1717
steps:
1818
- uses: actions/checkout@v2

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Changelog
22

3+
## [0.11.0] - 2020-04-17
4+
5+
### Added
6+
7+
- Python 3.10 support (added to test suite)
8+
9+
### Removed
10+
11+
- Python 3.6 support
12+
13+
### Changed
14+
15+
- Use `tomli` instead of `toml` package in in preparation for
16+
https://www.python.org/dev/peps/pep-0680/ (tomli is the basis for pythons
17+
future builtin toml support)
18+
- Updated dependencies
19+
20+
321
## [0.10.0] - 2020-04-17
422

523
### Changed

climatecontrol/file_loaders.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
from .fragment import Fragment
1212

1313
try:
14-
import toml
14+
import tomli
1515
except ImportError: # pragma: nocover
16-
toml = None # type: ignore
16+
tomli = None # type: ignore
1717
try:
1818
import yaml
1919
except ImportError: # pragma: nocover
@@ -174,18 +174,18 @@ class TomlLoader(FileLoader):
174174
def from_content(cls, content: str) -> Any:
175175
"""Load toml from string."""
176176
cls._check_toml()
177-
return toml.loads(content)
177+
return tomli.loads(content)
178178

179179
@classmethod
180180
def from_path(cls, path: str):
181181
"""Load toml from file at path."""
182182
cls._check_toml()
183-
with open(path) as f:
184-
return toml.load(f)
183+
with open(path, "rb") as f:
184+
return tomli.load(f)
185185

186186
@staticmethod
187187
def _check_toml():
188-
if toml is None:
188+
if tomli is None:
189189
raise ImportError(
190190
'"toml" package needs to be installed to parse toml files.'
191191
)

0 commit comments

Comments
 (0)