Skip to content

Commit b995816

Browse files
authored
Merge pull request #676 from atlanhq/APP-6839
APP-6839: Migrate to `uv`
2 parents 2e433e1 + c1f55e7 commit b995816

Some content is hidden

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

66 files changed

+7788
-279
lines changed

.dockerignore

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Python files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
env/
8+
venv/
9+
.venv/
10+
pip-log.txt
11+
pip-delete-this-directory.txt
12+
.tox/
13+
.coverage
14+
.coverage.*
15+
.cache
16+
nosetests.xml
17+
coverage.xml
18+
*.cover
19+
*.log
20+
.git
21+
.mypy_cache
22+
.pytest_cache
23+
.hypothesis
24+
25+
# IDE files
26+
.vscode/
27+
.idea/
28+
*.swp
29+
*.swo
30+
31+
# OS files
32+
.DS_Store
33+
.DS_Store?
34+
._*
35+
.Spotlight-V100
36+
.Trashes
37+
ehthumbs.db
38+
Thumbs.db
39+
40+
# Documentation
41+
docs/
42+
*.md
43+
*.rst
44+
45+
# Tests
46+
tests/
47+
test/
48+
49+
# CI/CD
50+
.github/
51+
.gitlab-ci.yml
52+
.travis.yml
53+
54+
# Package build
55+
build/
56+
dist/
57+
*.egg-info/
58+
59+
# Development
60+
.env
61+
.env.*
62+
requirements-dev.txt
63+
64+
# Temporary files
65+
tmp/
66+
temp/
67+
.tmp/

.github/workflows/pyatlan-pr.yaml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424

25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v6
27+
2528
- uses: pypa/[email protected]
2629
with:
2730
# Since we used pytest for dev
@@ -56,22 +59,21 @@ jobs:
5659
with:
5760
python-version: ${{ matrix.python-version }}
5861

62+
- name: Install uv
63+
uses: astral-sh/setup-uv@v6
64+
5965
- name: Install dependencies
60-
run: |
61-
python -m pip install --no-cache-dir --upgrade pip setuptools
62-
if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; fi
63-
if [ -f requirements-dev.txt ]; then pip install --no-cache-dir -r requirements-dev.txt; fi
66+
run: uv sync --extra dev
6467

6568
- name: QA checks (ruff-format, ruff-lint, mypy)
66-
run: |
67-
./qa-checks
69+
run: uv run ./qa-checks
6870

6971
- name: Run unit tests
7072
env: # Test tenant environment variables
7173
ATLAN_API_KEY: ${{ secrets.ATLAN_API_KEY }}
7274
ATLAN_BASE_URL: ${{ secrets.ATLAN_BASE_URL }}
7375
# Run with `pytest-sugar` for enhancing the overall test report output
74-
run: pytest tests/unit --force-sugar
76+
run: uv run pytest tests/unit --force-sugar
7577

7678
- name: Prepare integration tests distribution
7779
id: distribute-integration-test-files
@@ -102,11 +104,11 @@ jobs:
102104
# https://github.com/actions/setup-python/issues/160"
103105
python-version: "3.9"
104106

107+
- name: Install uv
108+
uses: astral-sh/setup-uv@v6
109+
105110
- name: Install dependencies
106-
run: |
107-
python -m pip install --no-cache-dir --upgrade pip setuptools
108-
if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; fi
109-
if [ -f requirements-dev.txt ]; then pip install --no-cache-dir -r requirements-dev.txt; fi
111+
run: uv sync --extra dev
110112

111113
- name: Run integration tests
112114
env: # Test tenant environment variables
@@ -118,4 +120,4 @@ jobs:
118120
timeout_minutes: 10 # Maximum time per test job; otherwise, the job will fail
119121
# Run the integration test file using `pytest-timer` plugin
120122
# to display only the durations of the 10 slowest tests with `pytest-sugar`
121-
command: pytest ${{ matrix.test_file }} -p name_of_plugin --timer-top-n 10 --force-sugar
123+
command: uv run pytest ${{ matrix.test_file }} -p name_of_plugin --timer-top-n 10 --force-sugar

.github/workflows/pyatlan-publish.yaml

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,22 @@ jobs:
2828
uses: actions/setup-python@v5
2929
with:
3030
python-version: '3.9'
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v6
3133
- name: Install dependencies
32-
run: |
33-
python -m pip install --upgrade pip
34-
pip install build
34+
run: uv sync --extra dev
3535
- name: check tag
3636
id: check-tag
37-
run: python check_tag.py
38-
- name: Build package
39-
run: python -m build
40-
- name: Publish package
41-
uses: pypa/[email protected]
42-
with:
43-
user: __token__
44-
password: ${{ secrets.PYPI_API_TOKEN }}
37+
run: uv run python check_tag.py
38+
- name: Build and publish to PyPI
39+
env:
40+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
41+
run: |
42+
uv build
43+
uv publish
4544
- name: Build Lambda layer
4645
run: |
47-
pip install --target=python .
46+
uv pip install --target=python .
4847
- uses: actions/upload-artifact@v4
4948
with:
5049
name: lambda-layer
@@ -62,15 +61,7 @@ jobs:
6261
registry: ghcr.io
6362
username: ${{ github.actor }}
6463
password: ${{ secrets.GITHUB_TOKEN }}
65-
- name: Login to Docker Hub
66-
uses: docker/login-action@v3
67-
with:
68-
username: ${{ vars.DOCKERHUB_USERNAME }}
69-
password: ${{ secrets.DOCKERHUB_TOKEN }}
70-
- name: Copy logging.conf
71-
run: |
72-
mkdir -p ./containers/base
73-
cp ./pyatlan/logging.conf ./containers/base/
64+
7465
- name: Set image tag from file
7566
id: set-image-tag
7667
run: |
@@ -83,7 +74,9 @@ jobs:
8374
push: true
8475
tags: |
8576
ghcr.io/atlanhq/atlan-python:${{ env.IMAGE_TAG }}
86-
cedocker1/pyatlan:${{ env.IMAGE_TAG }}
87-
context: ./containers
88-
file: ./containers/Dockerfile
77+
ghcr.io/atlanhq/atlan-python:latest
78+
context: .
79+
file: ./Dockerfile
8980
build-args: VERSION=${{ env.IMAGE_TAG }}
81+
cache-from: type=gha
82+
cache-to: type=gha,mode=max

.github/workflows/pyatlan-test-cron.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ jobs:
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222

23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v6
25+
2326
- name: Install dependencies
24-
run: |
25-
python -m pip install --upgrade pip
26-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
27-
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
27+
run: uv sync --extra dev
2828

29-
- name: QA checks (black, flake8, mypy)
30-
run: |
31-
./qa-checks
29+
- name: QA checks (ruff-format, ruff-lint, mypy)
30+
run: uv run ./qa-checks
3231

3332
- name: Test with pytest
3433
env: # Or as an environment variable
@@ -37,5 +36,5 @@ jobs:
3736
# Run the integration test suite using the `pytest-timer` plugin
3837
# to display only the durations of the 25 slowest tests with `pytest-sugar`
3938
run: |
40-
pytest tests/unit
41-
pytest tests/integration -p name_of_plugin --timer-top-n 25
39+
uv run pytest tests/unit
40+
uv run pytest tests/integration -p name_of_plugin --timer-top-n 25

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ repos:
77
- id: trailing-whitespace
88
- id: debug-statements
99

10+
# Use uv to run formatting and QA tools
1011
- repo: https://github.com/astral-sh/ruff-pre-commit
1112
rev: v0.9.7
1213
hooks:
@@ -15,3 +16,12 @@ repos:
1516
name: ruff-check-autofix
1617
args: ["check", "--select", "I", "--fix", "--silent"]
1718
- id: ruff-format
19+
- repo: local
20+
hooks:
21+
- id: qa-checks
22+
name: qa-checks
23+
entry: uv run ./qa-checks
24+
language: system
25+
types: [python]
26+
pass_filenames: false
27+
stages: [manual]

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM python:3.11-slim
2+
3+
ARG VERSION
4+
5+
# Install uv for faster package management
6+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
7+
8+
# Install pyatlan from PyPI
9+
RUN --mount=type=cache,target=/root/.cache/uv \
10+
uv pip install --system --no-cache-dir pyatlan==${VERSION}
11+
12+
# Set working directory
13+
WORKDIR /app
14+
15+
CMD ["python"]

HISTORY.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 7.1.2 (July 11, 2025)
2+
3+
### QOL Improvements
4+
5+
- Fixed `suggestions_test` integration test.
6+
- Generated latest typedefs models.
7+
- Updated Dockerfile to use `python:3.11-slim`.
8+
- Migrated SDK to use [`uv`](https://docs.astral.sh/uv) for development, building, and publishing the SDK.
9+
- Added `delete_type:HARD` optional parameter to `AssetClient.purge_by_guid()` method.
10+
- Made `FluentSearch` usage in `get_by_*()` methods consistent with `GET` API (return `active` and `archived` assets).
11+
112
## 7.1.1 (June 30, 2025)
213

314
### QOL Improvements

0 commit comments

Comments
 (0)