Skip to content

Commit baa6b71

Browse files
authored
enh: naming (#6)
* chore: code sandbox * pydoc * ci: add * chore: align namings * lint * lint * fix: ci * fix: ci * bump
1 parent 3fa772a commit baa6b71

53 files changed

Lines changed: 985 additions & 659 deletions

Some content is hidden

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

‎.github/workflows/build.yml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
python-build:
12+
name: Python Build & Test (${{ matrix.python-version }})
13+
strategy:
14+
matrix:
15+
python-version: ['3.11', '3.12']
16+
uses: ./.github/workflows/reusable-python.yml
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
install-extras: test,typing
20+
extra-packages: dbus-python keyring secretstorage
21+
run-tests: true
22+
test-command: pytest tests/ --cov=code_sandboxes --cov-report term-missing
23+
run-mypy: true
24+
mypy-target: code_sandboxes
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Py Code Style
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
paths:
9+
- 'code_sandboxes/**/*.py'
10+
- 'tests/**/*.py'
11+
- 'pyproject.toml'
12+
- 'setup.py'
13+
- '.pre-commit-config.yaml'
14+
- 'ruff.toml'
15+
- '.ruff.toml'
16+
- '.github/workflows/py-code-style.yml'
17+
- '.github/workflows/reusable-python.yml'
18+
pull_request:
19+
branches:
20+
- main
21+
- develop
22+
paths:
23+
- 'code_sandboxes/**/*.py'
24+
- 'tests/**/*.py'
25+
- 'pyproject.toml'
26+
- 'setup.py'
27+
- '.pre-commit-config.yaml'
28+
- 'ruff.toml'
29+
- '.ruff.toml'
30+
- '.github/workflows/py-code-style.yml'
31+
- '.github/workflows/reusable-python.yml'
32+
workflow_dispatch:
33+
34+
concurrency:
35+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
36+
cancel-in-progress: true
37+
38+
jobs:
39+
check-code-style:
40+
uses: ./.github/workflows/reusable-python.yml
41+
with:
42+
python-version: '3.11'
43+
extra-packages: pre-commit
44+
run-pre-commit: true

‎.github/workflows/py-tests.yml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Py Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'code_sandboxes/**'
9+
- 'tests/**'
10+
- 'pyproject.toml'
11+
- 'setup.py'
12+
- 'requirements*.txt'
13+
- '**/*.py'
14+
- '.github/workflows/py-tests.yml'
15+
- '.github/workflows/reusable-python.yml'
16+
pull_request:
17+
branches:
18+
- main
19+
paths:
20+
- 'code_sandboxes/**'
21+
- 'tests/**'
22+
- 'pyproject.toml'
23+
- 'setup.py'
24+
- 'requirements*.txt'
25+
- '**/*.py'
26+
- '.github/workflows/py-tests.yml'
27+
- '.github/workflows/reusable-python.yml'
28+
29+
workflow_dispatch:
30+
31+
jobs:
32+
tests:
33+
strategy:
34+
max-parallel: 1
35+
matrix:
36+
python-version: ['3.10', '3.11', '3.12', '3.13']
37+
uses: ./.github/workflows/reusable-python.yml
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
install-extras: test
41+
extra-packages: dbus-python keyring secretstorage
42+
run-tests: true
43+
test-command: pytest tests/ --cov=code_sandboxes --cov-report term-missing

‎.github/workflows/py-typing.yml‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Py Type Checking
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
paths:
9+
- 'code_sandboxes/**/*.py'
10+
- 'tests/**/*.py'
11+
- 'pyproject.toml'
12+
- 'setup.py'
13+
- 'mypy.ini'
14+
- '.mypy.ini'
15+
- '.github/workflows/py-typing.yml'
16+
- '.github/workflows/reusable-python.yml'
17+
pull_request:
18+
branches:
19+
- main
20+
- develop
21+
paths:
22+
- 'code_sandboxes/**/*.py'
23+
- 'tests/**/*.py'
24+
- 'pyproject.toml'
25+
- 'setup.py'
26+
- 'mypy.ini'
27+
- '.mypy.ini'
28+
- '.github/workflows/py-typing.yml'
29+
- '.github/workflows/reusable-python.yml'
30+
workflow_dispatch:
31+
32+
concurrency:
33+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
34+
cancel-in-progress: true
35+
36+
jobs:
37+
type-check:
38+
uses: ./.github/workflows/reusable-python.yml
39+
with:
40+
python-version: '3.12'
41+
install-extras: typing
42+
extra-packages: types-requests
43+
run-mypy: true
44+
mypy-target: code_sandboxes
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Reusable Python Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-version:
7+
description: Python version to use
8+
required: false
9+
type: string
10+
default: '3.11'
11+
install-system-deps:
12+
description: Install Linux system dependencies and unlock keyring
13+
required: false
14+
type: boolean
15+
default: true
16+
install-extras:
17+
description: Optional extras to install from pyproject (for example test,typing)
18+
required: false
19+
type: string
20+
default: ''
21+
extra-packages:
22+
description: Optional extra packages to install with uv pip
23+
required: false
24+
type: string
25+
default: ''
26+
run-tests:
27+
description: Run tests
28+
required: false
29+
type: boolean
30+
default: false
31+
test-command:
32+
description: Test command to run when run-tests=true
33+
required: false
34+
type: string
35+
default: 'pytest -q'
36+
run-mypy:
37+
description: Run mypy
38+
required: false
39+
type: boolean
40+
default: false
41+
mypy-target:
42+
description: Package/module path to type-check
43+
required: false
44+
type: string
45+
default: ''
46+
run-pre-commit:
47+
description: Run pre-commit
48+
required: false
49+
type: boolean
50+
default: false
51+
52+
jobs:
53+
python-checks:
54+
runs-on: ubuntu-latest
55+
56+
steps:
57+
- name: Install system dependencies
58+
if: inputs.install-system-deps
59+
run: |
60+
sudo apt-get update
61+
sudo apt-get install -y libdbus-1-3 libdbus-1-dev libglib2.0-dev
62+
63+
- name: Checkout
64+
uses: actions/checkout@v6
65+
66+
- name: Setup UV
67+
uses: astral-sh/setup-uv@v7
68+
with:
69+
version: latest
70+
python-version: ${{ inputs.python-version }}
71+
activate-environment: true
72+
73+
- name: Install dependencies
74+
run: |
75+
uv pip install .
76+
if [[ -n "${{ inputs.install-extras }}" ]]; then
77+
uv pip install ".[${{ inputs.install-extras }}]"
78+
fi
79+
if [[ -n "${{ inputs.extra-packages }}" ]]; then
80+
uv pip install ${{ inputs.extra-packages }}
81+
fi
82+
83+
- name: Unlock keyring
84+
if: inputs.install-system-deps
85+
uses: t1m0thyj/unlock-keyring@v1
86+
87+
- name: Configure git to use https
88+
run: git config --global hub.protocol https
89+
90+
- name: Run tests
91+
if: inputs.run-tests
92+
run: ${{ inputs.test-command }}
93+
94+
- name: Run mypy
95+
if: inputs.run-mypy
96+
run: mypy ${{ inputs.mypy-target }}
97+
98+
- name: Run pre-commit
99+
if: inputs.run-pre-commit
100+
run: pre-commit run --all-files

‎.licenserc.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ header:
1515
- 'docs/**/*'
1616
- 'LICENSE'
1717

18-
comment: on-failure
18+
comment: on-failure

‎.vscode/settings.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"packageManager": "ms-python.python:conda"
77
}
88
]
9-
}
9+
}

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@
55
-->
66

77
# Changelog
8+
9+
## Unreleased
10+
11+
- Breaking change: sandbox variant names are `eval`, `docker`, `jupyter`, and `datalayer`.
12+
- Removed support for the older `local-*` variant names from the public API and documentation.
13+
- Clarified in the documentation that `Sandbox.create()` defaults to `datalayer`.

‎LICENSE‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2626
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2727
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2828
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)