Skip to content

Commit e3119d7

Browse files
Fix: Use FileNotFoundError for file not found in main.py
Replaced IOError with FileNotFoundError on line 377 of main.py to use a more specific and appropriate exception for file not found errors. test: update test_find_dotenv_no_file_raise to expect FileNotFoundError Updated test_main.py (line 351) to replace IOError with FileNotFoundError so that the test matches the updated exception handling in main.py.
0 parents  commit e3119d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+4592
-0
lines changed

.bumpversion.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[bumpversion]
2+
current_version = 1.2.2
3+
commit = True
4+
tag = True
5+
6+
[bumpversion:file:src/dotenv/version.py]

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# see: http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{py,rst,ini}]
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.yml]
16+
indent_style = space
17+
indent_size = 2

.github/SECURITY.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
| Version | Supported |
6+
| --------- | ------------------ |
7+
| latest | :white_check_mark: |
8+
| 0.x | :x: |
9+
10+
## Reporting a Vulnerability
11+
12+
If you believe you have identified a security issue with python-dotenv, please email
13+
python-dotenv@saurabh-kumar.com. A maintainer will contact you acknowledging the report
14+
and how to continue.
15+
16+
Be sure to include as much detail as necessary in your report. As with reporting normal
17+
issues, a minimal reproducible example will help the maintainers address the issue faster.
18+
If you are able, you may also include a fix for the issue generated with `git format-patch`.

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Keep GitHub Actions up to date with GitHub's Dependabot...
2+
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
3+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
4+
version: 2
5+
updates:
6+
- package-ecosystem: github-actions
7+
directory: /
8+
groups:
9+
github-actions:
10+
patterns:
11+
- "*" # Group all Actions updates into a single larger pull request
12+
schedule:
13+
interval: weekly

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
# Specifying a GitHub environment is optional, but strongly encouraged
11+
environment: release
12+
permissions:
13+
# IMPORTANT: this permission is mandatory for trusted publishing
14+
id-token: write
15+
# Required for pushing to gh-pages branch
16+
contents: write
17+
18+
steps:
19+
- uses: actions/checkout@v6
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v6
23+
with:
24+
python-version: "3.x"
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install build
30+
31+
- name: Build package distributions
32+
run: make sdist
33+
34+
- name: Publish package distributions to PyPI
35+
uses: pypa/gh-action-pypi-publish@release/v1
36+
37+
- name: Build Documentation
38+
run: |
39+
pip install -r requirements-docs.txt
40+
pip install -e .
41+
mkdocs build
42+
43+
- name: Deploy to GitHub Pages
44+
uses: peaceiris/actions-gh-pages@v4
45+
with:
46+
github_token: ${{ secrets.GITHUB_TOKEN }}
47+
publish_dir: ./site

.github/workflows/test.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
test:
15+
runs-on: ${{ matrix.os }}
16+
timeout-minutes: 15
17+
18+
strategy:
19+
fail-fast: false
20+
max-parallel: 8
21+
matrix:
22+
os:
23+
- ubuntu-latest
24+
python-version:
25+
["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", pypy3.11]
26+
include:
27+
# Windows: Test lowest and highest supported Python versions
28+
- os: windows-latest
29+
python-version: "3.10"
30+
- os: windows-latest
31+
python-version: "3.14"
32+
33+
steps:
34+
- uses: actions/checkout@v6
35+
36+
- name: Set up Python ${{ matrix.python-version }}
37+
uses: actions/setup-python@v6
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
allow-prereleases: true
41+
42+
- name: Upgrade pip
43+
run: python -m pip install --upgrade pip
44+
45+
- name: Install dependencies
46+
run: pip install tox tox-gh-actions
47+
48+
- name: Test with tox
49+
run: tox

.gitignore

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
.DS_Store
2+
.idea
3+
.vscode/
4+
5+
# Created by https://www.gitignore.io/api/python
6+
# Edit at https://www.gitignore.io/?templates=python
7+
8+
### Python ###
9+
# Byte-compiled / optimized / DLL files
10+
__pycache__/
11+
*.py[cod]
12+
*$py.class
13+
14+
# C extensions
15+
*.so
16+
17+
# Distribution / packaging
18+
.Python
19+
build/
20+
develop-eggs/
21+
dist/
22+
downloads/
23+
eggs/
24+
.eggs/
25+
lib/
26+
lib64/
27+
parts/
28+
sdist/
29+
var/
30+
wheels/
31+
pip-wheel-metadata/
32+
share/python-wheels/
33+
*.egg-info/
34+
.installed.cfg
35+
*.egg
36+
MANIFEST
37+
38+
# PyInstaller
39+
# Usually these files are written by a python script from a template
40+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
41+
*.manifest
42+
*.spec
43+
44+
# Installer logs
45+
pip-log.txt
46+
pip-delete-this-directory.txt
47+
48+
# Unit test / coverage reports
49+
htmlcov/
50+
.tox/
51+
.nox/
52+
.coverage
53+
.coverage.*
54+
.cache
55+
nosetests.xml
56+
coverage.xml
57+
*.cover
58+
.hypothesis/
59+
.pytest_cache/
60+
61+
# Translations
62+
*.mo
63+
*.pot
64+
65+
# Django stuff:
66+
*.log
67+
local_settings.py
68+
db.sqlite3
69+
70+
# Flask stuff:
71+
instance/
72+
.webassets-cache
73+
74+
# Scrapy stuff:
75+
.scrapy
76+
77+
# Sphinx documentation
78+
docs/_build/
79+
80+
# PyBuilder
81+
target/
82+
83+
# Jupyter Notebook
84+
.ipynb_checkpoints
85+
86+
# IPython
87+
profile_default/
88+
ipython_config.py
89+
90+
# pyenv
91+
.python-version
92+
93+
# celery beat schedule file
94+
celerybeat-schedule
95+
96+
# SageMath parsed files
97+
*.sage.py
98+
99+
# Environments
100+
.env
101+
.venv
102+
env/
103+
venv/
104+
ENV/
105+
env.bak/
106+
venv.bak/
107+
108+
# Spyder project settings
109+
.spyderproject
110+
.spyproject
111+
112+
# Rope project settings
113+
.ropeproject
114+
115+
# mkdocs documentation
116+
/site
117+
118+
# mypy
119+
.mypy_cache/
120+
.dmypy.json
121+
dmypy.json
122+
123+
# Pyre type checker
124+
.pyre/
125+
126+
### Python Patch ###
127+
.venv/
128+
129+
# End of https://www.gitignore.io/api/python

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.12.0
4+
hooks:
5+
# Run the linter.
6+
- id: ruff
7+
# Run the formatter.
8+
- id: ruff-format

0 commit comments

Comments
 (0)