From 679e089e5f08e6bf5f54efbe4d5fda3b5c9325e5 Mon Sep 17 00:00:00 2001 From: Rene Leonhardt <65483435+reneleonhardt@users.noreply.github.com> Date: Sun, 28 Apr 2024 09:38:18 +0200 Subject: [PATCH] chore(deps): Update dependencies --- .circleci/config.yaml | 30 ++++++++++++++++++------------ .github/dependabot.yml | 6 ++++++ ci-requirements.txt | 3 +++ dev-requirements.txt | 7 +++---- setup.py | 4 +++- 5 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 ci-requirements.txt diff --git a/.circleci/config.yaml b/.circleci/config.yaml index 8e36760b..b909bae8 100644 --- a/.circleci/config.yaml +++ b/.circleci/config.yaml @@ -3,43 +3,49 @@ version: 2.1 jobs: check_python_format: docker: - - image: circleci/python:3.9 + - image: cimg/python:3.12 steps: - checkout + - restore_cache: + keys: + - v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.txt" }}-{{ checksum "ci-requirements.txt" }} - run: name: "Check format of .py with ufmt" command: | - pip install black==22.12.0 - pip install usort==1.0.5 - pip install ufmt==2.0.1 + python3 -m venv venv + source venv/bin/activate + pip install -r ci-requirements.txt ufmt check . + - save_cache: + paths: + - ./venv + key: v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.txt" }}-{{ checksum "ci-requirements.txt" }} check_type_annotation: docker: - - image: circleci/python:3.9 + - image: cimg/python:3.12 steps: - checkout - restore_cache: keys: - - v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.txt" }} + - v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.txt" }}-{{ checksum "ci-requirements.txt" }} - run: name: install dependencies command: | python3 -m venv venv - . venv/bin/activate - pip install -r requirements.txt - pip install -r dev-requirements.txt + source venv/bin/activate + pip install -r requirements.txt -r dev-requirements.txt - run: name: "mypy" command: | - . venv/bin/activate + source venv/bin/activate mkdir .mypy_cache mypy --install-types --non-interactive ./ --cache-dir=.mypy_cache/ - save_cache: paths: - ./venv - key: v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.txt" }} + key: v1-dependencies-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.txt" }}-{{ checksum "ci-requirements.txt" }} workflows: frontend: jobs: - - check_python_format \ No newline at end of file + - check_python_format diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..81eea4df --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" # Update pip dependencies daily diff --git a/ci-requirements.txt b/ci-requirements.txt new file mode 100644 index 00000000..3e7f720b --- /dev/null +++ b/ci-requirements.txt @@ -0,0 +1,3 @@ +black==24.4.2 +usort==1.0.8.post1 +ufmt==2.5.1 diff --git a/dev-requirements.txt b/dev-requirements.txt index cf7e40b6..8f0d269c 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,3 @@ -black==22.12.0 -usort==1.0.5 -ufmt==2.0.1 -mypy==1.3.0 +-r ci-requirements.txt +mypy==1.10.0 +setuptools==69.5.1 diff --git a/setup.py b/setup.py index a67e3749..9998b7ca 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,13 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. # This software may be used and distributed according to the terms of the Llama 2 Community License Agreement. +from pkg_resources import parse_requirements from setuptools import find_packages, setup def get_requirements(path: str): - return [l.strip() for l in open(path)] + with open(path) as requirements: + return [r.project_name for r in parse_requirements(requirements)] setup(