-
Notifications
You must be signed in to change notification settings - Fork 17
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
Drop toml
dependency
#43
Conversation
https://toml.io/en/ uiri/toml#267 uiri/toml#279 (comment) While the TOML spec is alive and well, the `toml` package that was used in this project is dead (uiri/toml#267). There are several alternatives. `rtoml` is the fastest, but does not provide "round trip" guarantees (meaning that it can't load, then dump, and get an identical result). However, for simple loading and parsing it's fine. `tomli` is another alternative, but it is read-only (writing requires a separate `tomli-w` package), and requires files to be opened in binary mode to parse TOML. `tomlkit` is used by Poetry (from the Poetry author), but is currently 70x slower than `rtoml`. It's also important to note that the TOML parsing and settings loading is somewhat tangential to the focus of the inboard project. A separate project, https://github.com/br3ndonland/fastenv, is more focused on settings management, and may feature TOML support in the future. This commit will remove `toml` from the `fastapi` Poetry extras group. Note that `toml` is still a sub-dependency of some `dev-dependencies`, including pre-commit and pytest.
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/br3ndonland/inboard/4HT7LqmVEhJDeMqBoPF6y73VYd8c |
Codecov Report
@@ Coverage Diff @@
## develop #43 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 286 264 -22
=========================================
- Hits 286 264 -22
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.74%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
Description
While the TOML spec is alive and well, the
toml
package that was used in this project is dead (uiri/toml#267).There are several alternatives:
rtoml
is the fastest, but does not provide "round trip" guarantees (meaning that it can't load, then dump, and get an identical result). However, for simple loading and parsing it's fine. It also requires a Rust environment to compile from source, which may be a consideration on distributions like Alpine Linux.tomli
is another alternative, but it is read-only (writing requires a separatetomli-w
package), and requires files to be opened in binary mode to parse TOML.tomlkit
is used by Poetry (and is written by the original author of Poetry), but is currently 70x slower thanrtoml
.This PR will remove
toml
from thefastapi
Poetry extras group, and make the necessary source code changes.Rather than installing an alternative TOML package, the TOML logic will simply be removed from inboard, because the TOML parsing and settings loading was somewhat tangential to the focus of the project. A separate project, fastenv, is more focused on settings management, and may feature TOML support in the future.
Note that
toml
is still a sub-dependency of somedev-dependencies
, including pre-commit and pytest.Changes
toml
dependency (619f63c)Related
uiri/toml#267
uiri/toml#279 (comment)