From c06eebd53ffdb08fec0d2e5882f766e9e33f53aa Mon Sep 17 00:00:00 2001 From: ebner Date: Tue, 24 Mar 2026 13:53:01 +0100 Subject: [PATCH] revert shit --- create_proxy_channel.py | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/create_proxy_channel.py b/create_proxy_channel.py index da8d239..5f0ee96 100644 --- a/create_proxy_channel.py +++ b/create_proxy_channel.py @@ -3,11 +3,7 @@ from sqlalchemy.orm import sessionmaker from quetz.db_models import Channel, Base from quetz.config import Config -channels = { - "conda-forge": "https://conda.anaconda.org/conda-forge", - "paulscherrerinstitute": "https://anaconda.org/paulscherrerinstitute", - "slsdetectorgroup": "https://anaconda.org/slsdetectorgroup", -} +channel_name = "conda-forge" # Load your quetz config (picks up database.url from config.toml) config = Config("/data/config.toml") @@ -16,18 +12,17 @@ engine = create_engine(config.sqlalchemy_database_url) SessionLocal = sessionmaker(bind=engine) with SessionLocal() as db: - for channel_name, channel_url in channels.items(): - existing = db.query(Channel).filter(Channel.name == channel_name).first() - if not existing: - channel = Channel( - name=channel_name, - description=f"Proxy of {channel_name}", - private=False, - mirror_channel_url=channel_url, - mirror_mode="proxy", - ) - db.add(channel) - db.commit() - print(f"Channel created: {channel.name}") - else: - print(f"Skipping channel creation - channel already exists: {channel_name}") + existing = db.query(Channel).filter(Channel.name == channel_name).first() + if not existing: + channel = Channel( + name=channel_name, + description="Proxy of conda-forge", + private=False, + mirror_channel_url="https://conda.anaconda.org/conda-forge", + mirror_mode="proxy", + ) + db.add(channel) + db.commit() + print(f"Channel created: {channel.name}") + else: + print(f"Skipping channel creation - channel already exists: {channel_name}")