Skip to content

Commit 65e2f3a

Browse files
authored
Merge pull request #6 from dotenvx/wheels
wheel related
2 parents c74c4b6 + 86bf513 commit 65e2f3a

17 files changed

Lines changed: 1536 additions & 205 deletions

File tree

.github/workflows/ci.yml

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,74 @@ name: ci
33
on:
44
push:
55
branches: [main]
6-
tags: ['*']
6+
tags: ["v*"]
77
pull_request:
88
branches: [main]
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
test:
12-
runs-on: ubuntu-latest
15+
runs-on: ${{ matrix.os }}
1316
strategy:
14-
fail-fast: true
17+
fail-fast: false
1518
matrix:
16-
python-version: ["3.8", "3.9", "3.10", "3.11"]
19+
os: [ubuntu-latest, macos-latest, windows-latest]
20+
python-version: ["3.8", "3.13"]
1721
steps:
1822
- uses: actions/checkout@v4
19-
- uses: actions/setup-python@v4
23+
- uses: actions/setup-python@v5
2024
with:
2125
python-version: ${{ matrix.python-version }}
22-
- run: |
23-
python -m pip install --upgrade pip
24-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
26+
- uses: dtolnay/rust-toolchain@stable
27+
- run: python -m pip install maturin pytest
28+
- run: maturin build --locked --out dist
29+
- run: python -m pip install --no-index --find-links dist python-dotenvx
30+
- run: python -m pytest
2531

26-
# run only on semantic version tag
27-
release:
32+
wheels:
33+
if: startsWith(github.ref, 'refs/tags/v')
2834
needs: test
29-
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '.')
30-
runs-on: ubuntu-latest
35+
runs-on: ${{ matrix.os }}
3136
strategy:
32-
fail-fast: true
37+
fail-fast: false
38+
matrix:
39+
include:
40+
- os: ubuntu-latest
41+
target: x86_64
42+
manylinux: "2014"
43+
- os: ubuntu-latest
44+
target: aarch64
45+
manylinux: "2014"
46+
- os: macos-13
47+
target: x86_64
48+
- os: macos-14
49+
target: aarch64
50+
- os: windows-latest
51+
target: x64
3352
steps:
3453
- uses: actions/checkout@v4
35-
# GITHUB_ENV operates like a .env file
36-
- name: extract version
37-
run: |
38-
VERSION=${GITHUB_REF#refs/tags/}
39-
CLEAN_VERSION=${VERSION#v}
40-
echo "VERSION=$VERSION" >> $GITHUB_ENV
41-
echo "CLEAN_VERSION=$CLEAN_VERSION" >> $GITHUB_ENV
54+
- uses: PyO3/maturin-action@v1
55+
with:
56+
target: ${{ matrix.target }}
57+
manylinux: ${{ matrix.manylinux }}
58+
args: --release --out dist
59+
- uses: actions/upload-artifact@v4
60+
with:
61+
name: wheels-${{ matrix.os }}-${{ matrix.target }}
62+
path: dist
4263

43-
pypi:
44-
needs: release
64+
publish:
65+
if: startsWith(github.ref, 'refs/tags/v')
66+
needs: wheels
4567
runs-on: ubuntu-latest
4668
steps:
47-
- uses: actions/checkout@v4
48-
- uses: actions/setup-python@v4
69+
- uses: actions/download-artifact@v4
70+
with:
71+
pattern: wheels-*
72+
path: dist
73+
merge-multiple: true
74+
- uses: pypa/gh-action-pypi-publish@release/v1
4975
with:
50-
python-version: '3.11'
51-
- run: |
52-
python -m pip install --upgrade pip
53-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
54-
pip install setuptools wheel twine build
55-
- name: publish
56-
env:
57-
TWINE_USERNAME: __token__
58-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
59-
run: make release
76+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ __pycache__/
55

66
# C extensions
77
*.so
8+
*.pyd
9+
*.dylib
810

911
# Distribution / packaging
1012
.Python
@@ -73,6 +75,7 @@ docs/_build/
7375

7476
# PyBuilder
7577
target/
78+
.tmp-publish/
7679

7780
# Jupyter Notebook
7881
.ipynb_checkpoints

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,34 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5-
## [Unreleased](https://github.com/dotenvx/python-dotenvx/compare/v0.3.0...main)
5+
## [Unreleased](https://github.com/dotenvx/python-dotenvx/compare/v2.0.0...main)
6+
7+
## [2.0.0](https://github.com/dotenvx/python-dotenvx/compare/v0.3.0...v2.0.0)
8+
9+
### Added
10+
11+
- Add `load_dotenv`, `dotenv_values`, and `find_dotenv` with the same public
12+
arguments and defaults as `python-dotenv`.
13+
- Add native dotenv parsing, expansion, command substitution, and decryption
14+
through `dotenvx-primitives` 2.1.1.
15+
- Add automatic decryption using `DOTENV_PRIVATE_KEY` environment variables
16+
or a neighboring `.env.keys` file.
17+
- Add conformance tests against `python-dotenv` 1.2.2, plus dotenvx encrypted
18+
loading behavior.
19+
20+
### Changed
21+
22+
- Package the Rust implementation as a PyO3 native extension inside each
23+
Python wheel.
24+
- Build and publish Linux, macOS, and Windows wheels using Maturin.
25+
- Use Python ABI3 wheels compatible with CPython 3.8 and newer.
26+
- Keep `load_dotenvx` as a backward-compatible API returning parsed values.
27+
28+
### Removed
29+
30+
- Remove the `dotenvx-postinstall` command and runtime dotenvx CLI download.
31+
- Remove the external dotenvx executable dependency.
32+
- Remove the legacy setuptools build configuration.
633

734
## [0.3.0](https://github.com/dotenvx/dotenvx/compare/v0.2.6...v0.3.0)
835

0 commit comments

Comments
 (0)