Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV - Clean and update dependencies #792

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8d1136e
:pushpin: Clean dev and runtime deps - server
trallard Mar 20, 2024
b85208e
:arrow_up: Bump pre-commit deps
trallard Mar 20, 2024
48ec413
:heavy_minus_sign: Remove runtime deps
trallard Mar 20, 2024
757677f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 20, 2024
d365061
Bump GH actions workflows
trallard Mar 20, 2024
cff7ed5
Merge branch 'trallard/clean-dependencies' of https://github.com/cond…
trallard Mar 20, 2024
e52de2f
Add pre-commit ci
trallard Mar 20, 2024
383236f
Update lint hatch script
trallard Mar 20, 2024
6a34329
Add updated intro docs
trallard Mar 20, 2024
f1dfe9a
Update hatch syntax
trallard Mar 20, 2024
d4c3b73
:construction_worker: Ensure we always install packages
trallard Mar 20, 2024
3f1b16e
:fire: Remove redundant env.yaml file
trallard Mar 20, 2024
b7ea23e
:fire: Remove yaml files
trallard Mar 20, 2024
e9b03a1
Update conda-store/pyproject.toml
trallard Mar 21, 2024
c8cdce9
Update pyproject.toml - isort and maintainers
trallard Mar 21, 2024
cf5df1e
:memo: Update contributing docs
trallard Mar 21, 2024
bcdb39a
:construction_worker: Pin BAIPP to v1
trallard Mar 21, 2024
390fc5f
More updates to GH actions
trallard Mar 21, 2024
69a49ca
:heavy_plus_sign: Add hatch to action
trallard Mar 21, 2024
4aa7d7b
Fix typo
trallard Mar 21, 2024
1431419
Fix artefacts name
trallard Mar 21, 2024
8fcf259
:construction_worker: Improve deps in CI
trallard Mar 22, 2024
967f11a
Merge branch 'trallard/clean-dependencies' of https://github.com/cond…
trallard Mar 22, 2024
696d61b
Pin build deps
trallard Mar 22, 2024
997faa2
Pin build deps
trallard Mar 22, 2024
afc2061
:arrow_up: Use baipp from main
trallard Mar 25, 2024
16bae5c
Fix twine version pin
trallard Mar 25, 2024
16911ad
Remove flower from dev
trallard Mar 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_docker_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v4

- name: "Retrieve secret from Vault 🗝"
uses: hashicorp/vault-action@v2
uses: hashicorp/vault-action@v3
with:
method: jwt
url: "https://quansight-vault-public-vault-b2379fa7.d415e30e.z1.hashicorp.cloud:8200"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ jobs:
- run: echo "Running on ${{ matrix.directory }}"

- name: "Check package build - ${{ matrix.directory }} 📦"
uses: hynek/build-and-inspect-python-package@v1
uses: hynek/build-and-inspect-python-package@v2
with:
path: ${{ matrix.directory }}

# Adding a separate upload for publishing
- name: "Upload build artefacts 📤"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.directory }}-package
path: |
Expand All @@ -69,7 +69,7 @@ jobs:

steps:
- name: "Download build artefacts 📥"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.directory }}-package
path: dist
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:

steps:
- name: "Download build artefacts 📥"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.directory }}-package
path: dist
Expand Down
39 changes: 18 additions & 21 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ jobs:
strategy:
matrix:
os: ["ubuntu", "macos", "windows"]
include:
- os: ubuntu
environment-file: conda-store-server/environment-dev.yaml
- os: macos
environment-file: conda-store-server/environment-macos-dev.yaml
- os: windows
environment-file: conda-store-server/environment-windows-dev.yaml
runs-on: ${{ matrix.os }}-latest
defaults:
run:
Expand All @@ -37,9 +30,9 @@ jobs:
uses: actions/checkout@v4

- name: "Set up env ${{ matrix.os }} 🐍"
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: ${{ matrix.environment-file }}
environment-file: conda-store-server/environment-dev.yaml
miniforge-version: latest

# This fixes a "DLL not found" issue importing ctypes from the hatch env
Expand All @@ -54,12 +47,16 @@ jobs:

- name: "Linting Checks 🧹"
run: |
hatch env run -e dev lint
hatch env run -e lint lint
trallard marked this conversation as resolved.
Show resolved Hide resolved

- name: "Build package 📦"
run: |
hatch build

- name: "Installed built conda-store-server 📦"
run: |
pip install dist/*.whl

- name: "Unit tests ✅"
run: |
pytest -m "not extended_prefix and not user_journey" tests
Expand Down Expand Up @@ -89,7 +86,7 @@ jobs:
uses: actions/checkout@v4

- name: "Set up env 🐍"
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: conda-store-server/environment-dev.yaml
miniforge-version: latest
Expand All @@ -114,11 +111,11 @@ jobs:
pytest --video on ../tests/test_playwright.py

- name: "Upload test results 📤"
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: playwright-tests
path: conda-store-server/test-results
path: conda-store-server/test-results/

- name: "Run integration tests ✅"
run: |
Expand All @@ -142,13 +139,13 @@ jobs:
working-directory: conda-store
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: "Checkout Repository 🛎"
uses: actions/checkout@v4

- name: "Set up Python 🐍"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -174,9 +171,9 @@ jobs:
wait-for-it localhost:9000 # minio
wait-for-it localhost:8080 # conda-store-server

- name: "Install conda-store for tests 📦"
- name: "Install built conda-store for tests 📦"
run: |
pip install .
pip install dist/*.whl

- name: "Run basic tests - not authenticated"
run: |
Expand Down Expand Up @@ -212,17 +209,17 @@ jobs:
- name: "Checkout Repository"
uses: actions/checkout@v4

- name: Set up Docker Buildx
- name: "Set up Docker Buildx"
uses: docker/setup-buildx-action@v3

- name: Lint Dockerfiles
- name: "Lint Dockerfiles"
uses: jbergstroem/hadolint-gh-action@v1
with:
dockerfile: ${{ matrix.docker-image }}/Dockerfile
output_format: tty
error_level: 0

- name: Docker Meta
- name: "Docker Meta"
id: meta
uses: docker/metadata-action@v5
with:
Expand All @@ -231,7 +228,7 @@ jobs:
tags: |
type=sha

- name: Build docker
- name: "Build docker"
uses: docker/build-push-action@v5
with:
context: "${{ matrix.docker-image }}"
Expand Down
15 changes: 10 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,28 @@
# - Register git hooks: pre-commit install --install-hooks
# - Run on all files: pre-commit run --all-files

ci:
autoupdate_schedule: monthly
autofix_commit_msg: |
[pre-commit.ci] Apply automatic pre-commit fixes

repos:
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 24.3.0
hooks:
- id: black
exclude: "examples|tests/assets"

- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: "v0.0.289"
rev: "v0.3.3"
hooks:
- id: ruff
exclude: "examples|tests/assets"
args: ["--fix"]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort
Expand All @@ -34,7 +39,7 @@ repos:
exclude: "conda-store-server/conda_store_server/action/__init__.py"

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
files: ".*\\.py"
Expand All @@ -44,7 +49,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.8
hooks:
- id: prettier
exclude: ^(examples/|templates/|)
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-01-29 03:56:36.889909

"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-12-13 21:01:45.546591

"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-08-24 12:01:48.461989

"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-11-17 14:34:40.688865

"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-06-01 18:37:12.396138

"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2024-01-28 14:31:35.723505

"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-08-05 22:14:34.110642

"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-11-29 09:02:35.835664

"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-07-15 14:22:00.351131

"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-05-11 16:38:12.210549

"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-07-04 14:35:48.177574

"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-11-07 12:25:04.416192

"""

import sqlalchemy as sa
from alembic import op

Expand Down
8 changes: 5 additions & 3 deletions conda-store-server/conda_store_server/server/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ async def api_get_permissions(
"status": "ok",
"data": {
"authenticated": authenticated,
"primary_namespace": entity.primary_namespace
if authenticated
else conda_store.default_namespace,
"primary_namespace": (
entity.primary_namespace
if authenticated
else conda_store.default_namespace
),
"entity_permissions": entity_binding_permissions,
"entity_roles": entity_binding_roles,
"expiration": entity.exp if authenticated else None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ def list_tags(
try:
auth.authorize_request(
request,
image
if parts[0] != "conda-store-dynamic"
else "conda-store-dynamic/python",
(
image
if parts[0] != "conda-store-dynamic"
else "conda-store-dynamic/python"
),
{Permissions.ENVIRONMENT_READ},
require=True,
)
Expand Down
Loading
Loading