Skip to content

Commit f04ac09

Browse files
authored
Version 0.4.0 release (#594)
* Version 0.4.0 release * Fix ci * Fix ci * Fix ci * Fix RTD * Fix RTD * Fix RTD * Fix RTD * Fix RTD * Fix RTD * Fix RTD
1 parent d8e6486 commit f04ac09

File tree

11 files changed

+490
-546
lines changed

11 files changed

+490
-546
lines changed

.github/workflows/test.yml

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', '3.10']
15+
python-version: ['3.7', '3.8', '3.9', '3.10']
1616

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

.pre-commit-hooks.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
- id: dotenv-linter
2-
name: dotenv-linter
3-
entry: dotenv-linter
4-
language: python
5-
types: [text]
6-
files: '\.env*'
1+
- id: dotenv-linter
2+
name: dotenv-linter
3+
entry: dotenv-linter
4+
language: python
5+
types: [text]
6+
files: '\.env*'

.readthedocs.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# .readthedocs.yml
2+
version: 2
3+
4+
# Set the version of Python and other tools you might need
5+
build:
6+
os: ubuntu-20.04
7+
tools:
8+
python: "3.9"
9+
jobs:
10+
pre_create_environment:
11+
- asdf plugin add poetry
12+
- asdf install poetry latest
13+
- asdf global poetry latest
14+
- poetry config virtualenvs.create false
15+
post_install:
16+
- |
17+
. "$(pwd | rev | sed 's/stuokcehc/svne/' | rev)/bin/activate"
18+
&& poetry install --with docs
19+
20+
# Build documentation in the docs/ directory with Sphinx
21+
sphinx:
22+
configuration: docs/conf.py
23+
fail_on_warning: true
24+
25+
formats: all

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
We follow Semantic Versions.
44

55

6+
## Version 0.4.0
7+
8+
### Features
9+
10+
- `python3.6` support is dropped
11+
- `pkg_resources` is removed, now `importlib_metadata` is used
12+
13+
614
## Version 0.3.0
715

816
### Features

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _get_project_meta():
9292
#
9393
# This is also used if you do content translation via gettext catalogs.
9494
# Usually you set "language" from the command line for these cases.
95-
language = None
95+
language = 'en'
9696

9797
# List of patterns, relative to source directory, that match files and
9898
# directories to ignore when looking for source files.

dotenv_linter/exceptions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from typing_extensions import final
12

3+
4+
@final
25
class ParsingError(Exception):
36
"""Used when dotenv file has incorrect grammar and cannot be parsed."""

dotenv_linter/grammar/fst.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from attr import dataclass, field
2323
from ply import lex
24+
from typing_extensions import final
2425

2526
from dotenv_linter.logics.text import normalize_text
2627

@@ -55,6 +56,7 @@ def from_token(cls: Type[TNode], token: lex.LexToken) -> TNode:
5556
)
5657

5758

59+
@final
5860
@dataclass(frozen=True)
5961
class Comment(Node):
6062
"""
@@ -64,12 +66,14 @@ class Comment(Node):
6466
"""
6567

6668

69+
@final
6770
@dataclass(frozen=True)
6871
class Name(Node):
6972
"""Represents an inline name which is used as a key for future values."""
7073

7174

72-
@dataclass(frozen=True) # noqa: WPS110
75+
@final # noqa: WPS110
76+
@dataclass(frozen=True)
7377
class Value(Node): # noqa: WPS110
7478
"""Represents an inline value which is used together with key."""
7579

@@ -79,6 +83,7 @@ class Statement(Node):
7983
"""Base class for all affecting statements."""
8084

8185

86+
@final
8287
@dataclass(frozen=True, slots=True)
8388
class Assign(Statement):
8489
"""Represents key-value pair separated by ``=``."""

dotenv_linter/version.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
import pkg_resources
1+
import sys
22

3+
# Note that we use ``sys.version_info`` directly,
4+
# because that's how ``mypy`` knows about what we are doing.
5+
if sys.version_info >= (3, 8): # pragma: no cover
6+
from importlib import metadata as importlib_metadata # noqa: WPS433
7+
else: # pragma: no cover
8+
import importlib_metadata # noqa: WPS440, WPS433
39

4-
def _get_version(dist_name: str) -> str: # pragma: no cover
5-
"""Fetches distribution name. Contains a fix for Sphinx."""
6-
try:
7-
return pkg_resources.get_distribution(dist_name).version
8-
except pkg_resources.DistributionNotFound:
9-
return '' # readthedocs can not install `poetry` projects
10+
11+
def _get_version(distribution_name: str) -> str: # pragma: no cover
12+
"""Fetches distribution version."""
13+
return importlib_metadata.version(distribution_name) # type: ignore
1014

1115

1216
pkg_name = 'dotenv-linter'
1317

1418
#: We store the version number inside the `pyproject.toml`:
15-
pkg_version: str = _get_version(pkg_name)
19+
pkg_version = _get_version(pkg_name)

0 commit comments

Comments
 (0)