Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge the changes from maintained fork atoml #151

Merged
merged 4 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- '*.*.*'
- "*.*.*"

jobs:
Release:
Expand All @@ -13,7 +13,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

- name: Get tag
id: tag
Expand All @@ -26,7 +26,7 @@ jobs:

- name: Install and set up Poetry
run: |
curl -fsS -o install-poetry.py https://raw.githubusercontent.com/sdispater/poetry/master/install-poetry.py
curl -fsSL -o install-poetry.py https://install.python-poetry.org
python install-poetry.py -y

- name: Update PATH
Expand Down
33 changes: 16 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,32 @@ on:
- develop
pull_request:
branches:
- '**'
- "**"

jobs:
Linting:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Linting
run: |
pip install pre-commit
pre-commit run --all-files
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
Tests:
needs: Linting
name: ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]

steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
submodules: "recursive"

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

Expand All @@ -51,11 +45,16 @@ jobs:
- name: Install Poetry
shell: bash
run: |
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
python get-poetry.py --preview -y
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
echo "%USERPROFILE%/.poetry/bin" >> $GITHUB_PATH
- name: Setup Poetry
curl -fsSL https://install.python-poetry.org | python - -y
- name: Update PATH
if: ${{ matrix.os != 'Windows' }}
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Update Path for Windows
if: ${{ matrix.os == 'Windows' }}
shell: bash
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
- name: Configure Poetry
shell: bash
run: |
poetry config virtualenvs.in-project true
Expand Down
9 changes: 4 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
repos:
- repo: https://github.com/ambv/black
rev: stable
rev: 21.12b0
hooks:
- id: black
python_version: python3.6
- id: black

- repo: https://github.com/timothycrosley/isort
rev: 5.1.4
rev: 5.10.1
hooks:
- id: isort
additional_dependencies: [toml]
exclude: ^.*/?setup\.py$

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
rev: v4.0.1
hooks:
- id: trailing-whitespace
exclude: ^tests/(toml-test|toml-spec-tests)/.*
Expand Down
41 changes: 16 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# Change Log

## [Unreleased]

### Changed

- Drop support for Python<3.6. ([#151](https://github.com/sdispater/tomlkit/pull/151))

### Fixed

- Fix a bug that tomlkit accepts an invalid table with missing `=`. ([#141](https://github.com/sdispater/tomlkit/issues/141))
- Fix the invalid dumping output when the key is empty. ([#143](https://github.com/sdispater/tomlkit/issues/143))
- Fix incorrect string returned by dumps when moving/renaming table. ([#144](https://github.com/sdispater/tomlkit/issues/144))
- Fix inconsistent dumps when replacing existing item with nested table. ([#145](https://github.com/sdispater/tomlkit/issues/145))
- Fix invalid dumps output when appending to a multiline array. ([#146](https://github.com/sdispater/tomlkit/issues/146))
- Fix the `KeyAlreadyExistError` when the table is separated into multiple parts. ([#148](https://github.com/sdispater/tomlkit/issues/148))

## [0.7.2] - 2021-05-20

### Fixed

- Fixed an error where container's data were lost when copying. ([#126](https://github.com/sdispater/tomlkit/pull/126))
- Fixed missing tests in the source distribution of the package. ([#127](https://github.com/sdispater/tomlkit/pull/127))


## [0.7.1] - 2021-05-19

### Fixed
Expand All @@ -19,7 +33,6 @@
- Fixed an error in top level keys handling when building documents programmatically. ([#122](https://github.com/sdispater/tomlkit/pull/122))
- Fixed compliance with mypy by adding a `py.typed` file. ([#109](https://github.com/sdispater/tomlkit/pull/109))


## [0.7.0] - 2020-07-31

### Added
Expand All @@ -34,28 +47,24 @@

- Fixed compliance with the 1.0.0rc1 TOML specification ([#102](https://github.com/sdispater/tomlkit/pull/102)).


## [0.6.0] - 2020-04-15

### Added

- Added support for heterogeneous arrays ([#92](https://github.com/sdispater/tomlkit/pull/92)).


## [0.5.11] - 2020-02-29

### Fixed

- Fix containers and our of order tables dictionary behavior ([#82](https://github.com/sdispater/tomlkit/pull/82)))


## [0.5.10] - 2020-02-28

### Fixed

- Fixed out of order tables not behaving properly ([#79](https://github.com/sdispater/tomlkit/pull/79))


## [0.5.9] - 2020-02-28

### Fixed
Expand All @@ -64,36 +73,31 @@
- Fixed parsing errors when single quotes are present in a table name ([#71](https://github.com/sdispater/tomlkit/pull/71)).
- Fixed parsing errors when parsing some table names ([#76](https://github.com/sdispater/tomlkit/pull/76)).


## [0.5.8] - 2019-10-11

### Added

- Added support for producing multiline arrays


## [0.5.7] - 2019-10-04

### Fixed

- Fixed handling of inline tables.


## [0.5.6] - 2019-10-04

### Fixed

- Fixed boolean comparison.
- Fixed appending inline tables to tables.


## [0.5.5] - 2019-07-01

### Fixed

- Fixed display of inline tables after element deletion.


## [0.5.4] - 2019-06-30

### Fixed
Expand All @@ -104,15 +108,13 @@
- Fixed behavior of `setdefault()` on containers (Thanks to [@AndyKluger](https://github.com/AndyKluger)).
- Fixed tables string representation.


## [0.5.3] - 2018-11-19

### Fixed

- Fixed copy of TOML documents.
- Fixed behavior on PyPy3.


## [0.5.2] - 2018-11-09

### Fixed
Expand All @@ -121,14 +123,12 @@
- Fixed comments being displayed in inline tables.
- Fixed string with non-scalar unicode code points not raising an error.


## [0.5.1] - 2018-11-08

### Fixed

- Fixed deletion and replacement of sub tables declared after other tables.


## [0.5.0] - 2018-11-06

### Changed
Expand All @@ -141,14 +141,12 @@
- Fixed comma handling when parsing inline tables. (Thanks to [@njalerikson](https://github.com/njalerikson))
- Fixed a `KeyAlreadyPresent` error when declaring a sub table after other tables.


## [0.4.6] - 2018-10-16

### Fixed

- Fixed string parsing behavior.


## [0.4.5] - 2018-10-12

### Fixed
Expand All @@ -157,14 +155,12 @@
- Fixed key comparison.
- Fixed an error when using pickle on TOML documents.


## [0.4.4] - 2018-09-01

### Fixed

- Fixed performances issues while parsing on Python 2.7.


## [0.4.3] - 2018-08-28

### Fixed
Expand All @@ -173,14 +169,12 @@
- Fixed missing newline after table header.
- Fixed dict-like behavior for tables and documents.


## [0.4.2] - 2018-08-06

### Fixed

- Fixed insertion of an element after deletion.


## [0.4.1] - 2018-08-06

### Fixed
Expand All @@ -189,7 +183,6 @@
- Fixed parsing of dotted keys inside tables.
- Fixed parsing of array of tables with same prefix.


## [0.4.0] - 2018-07-23

### Added
Expand All @@ -205,7 +198,6 @@

- Fixed potential new lines inside an inline table.


## [0.3.0] - 2018-07-20

### Changed
Expand All @@ -224,8 +216,7 @@
- Fixed handling of super tables with different sections.
- Fixed raw strings escaping.


[Unreleased]: https://github.com/sdispater/tomlkit/compare/0.7.2...master
[unreleased]: https://github.com/sdispater/tomlkit/compare/0.7.2...master
[0.7.2]: https://github.com/sdispater/tomlkit/releases/tag/0.7.2
[0.7.1]: https://github.com/sdispater/tomlkit/releases/tag/0.7.1
[0.7.0]: https://github.com/sdispater/tomlkit/releases/tag/0.7.0
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
[pypi_version]: https://img.shields.io/pypi/v/tomlkit.svg?logo=python&logoColor=white
[python_versions]: https://img.shields.io/pypi/pyversions/tomlkit.svg?logo=python&logoColor=white
[github_license]: https://img.shields.io/github/license/sdispater/tomlkit.svg?logo=github&logoColor=white
[travisci]: https://img.shields.io/travis/com/sdispater/tomlkit/master.svg?logo=travis&logoColor=white&label=Travis%20CI
[appveyor]: https://img.shields.io/appveyor/ci/sdispater/tomlkit/master.svg?logo=appveyor&logoColor=white&label=AppVeyor
[github_action]: https://github.com/sdispater/tomlkit/actions/workflows/tests.yml/badge.svg

<!--Codecov logo not offered by shields.io or simpleicons.org, this is Codecov's SVG image modified to be white-->

[codecov]: https://img.shields.io/codecov/c/github/sdispater/tomlkit/master.svg?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNDgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CgogPGc+CiAgPHRpdGxlPmJhY2tncm91bmQ8L3RpdGxlPgogIDxyZWN0IGZpbGw9Im5vbmUiIGlkPSJjYW52YXNfYmFja2dyb3VuZCIgaGVpZ2h0PSI0MDIiIHdpZHRoPSI1ODIiIHk9Ii0xIiB4PSItMSIvPgogPC9nPgogPGc+CiAgPHRpdGxlPkxheWVyIDE8L3RpdGxlPgogIDxwYXRoIGlkPSJzdmdfMSIgZmlsbC1ydWxlPSJldmVub2RkIiBmaWxsPSIjZmZmZmZmIiBkPSJtMjUuMDE0LDBjLTEzLjc4NCwwLjAxIC0yNS4wMDQsMTEuMTQ5IC0yNS4wMTQsMjQuODMybDAsMC4wNjJsNC4yNTQsMi40ODJsMC4wNTgsLTAuMDM5YTEyLjIzOCwxMi4yMzggMCAwIDEg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E4NCwwLjI3IC0wLjM2OSwwLjU2IC0wLjYsMC45NDJsLTAuMTI2LDAuMjE3Yy0wLjE4NCwwLjMxOCAtMC4zNDgsMC42MjIgLTAuNDg3LDAuOWwtMC4wMzMsMC4wNjFjLTAuMzU0LDAuNzExIC0wLjY2MSwxLjQ1NSAtMC45MTcsMi4yMTRsLTAuMDM2LDAuMTExYTE3LjEzLDE3LjEzIDAgMCAwIC0wLjg1NSw1LjY0NGwwLjAwMywwLjIzNGEyMy41NjUsMjMuNTY1IDAgMCAwIDAuMDQzLDAuODIyYzAuMDEsMC4xMyAwLjAyMywwLjI1OSAwLjAzNiwwLjM4OGMwLjAxNSwwLjE1OCAwLjAzNCwwLjMxNiAwLjA1MywwLjQ3MWwwLjAxMSwwLjA4OGwwLjAyOCwwLjIxNGMwLjAzNywwLjI2NCAwLjA4LDAuNTI1IDAuMTMsMC43ODdjMC41MDMsMi42MzcgMS43Niw1LjI3NCAzLjYzNSw3LjYyNWwwLjA4NSwwLjEwNmwwLjA4NywtMC4xMDRjMC43NDgsLTAuODg0IDIuNjAzLC0zLjY4NyAyLjc2LC01LjM2OWwwLjAwMywtMC4wMzFsLTAuMDE1LC0wLjAyOGExMS43MzYsMTEuNzM2IDAgMCAxIC0xLjMzMywtNS40MDdjMCwtNi4yODQgNC45NCwtMTEuNTAyIDExLjI0MywtMTEuODhsMC40MTQsLTAuMDE1YzIuNTYxLC0wLjA1OCA1LjA2NCwwLjY3MyA3LjIzLDIuMTM2bDAuMDU4LDAuMDM5bDQuMTk3LC0yLjQ0bDAuMDU1LC0wLjAzM2wwLC0wLjA2MmMwLjAwNiwtNi42MzIgLTIuNTkyLC0xMi44NjUgLTcuMzE0LC0xNy41NTFjLTQuNzE2LC00LjY3OSAtMTAuOTkxLC03LjI1NSAtMTcuNjcyLC03LjI1NSIvPgogPC9nPgo8L3N2Zz4=&label=Codecov

[![GitHub Release][github_release]](https://github.com/sdispater/tomlkit/releases/)
[![PyPI Version][pypi_version]](https://pypi.python.org/pypi/tomlkit/)
[![Python Versions][python_versions]](https://pypi.python.org/pypi/tomlkit/)
[![License][github_license]](https://github.com/sdispater/tomlkit/blob/master/LICENSE)
<br>
[![Travis CI][travisci]](https://travis-ci.com/sdispater/tomlkit)
[![AppVeyor][appveyor]](https://ci.appveyor.com/project/sdispater/tomlkit)
[![Codecov][codecov]](https://codecov.io/gh/sdispater/tomlkit)
[![Tests][github_action]](https://github.com/sdispater/tomlkit/actions/workflows/tests.yml)

# TOML Kit - Style-preserving TOML library for Python

Expand Down Expand Up @@ -152,7 +152,6 @@ It can be created with the following code:
>>> doc["database"] = database
```


## Installation

If you are using [Poetry](https://poetry.eustace.io),
Expand Down
Loading