From b9883895d355226f5636d65a2ff6e61110e6fd4d Mon Sep 17 00:00:00 2001 From: Dalena Date: Mon, 6 May 2024 17:40:18 -0500 Subject: [PATCH] feat: python 3.12 (#12) * feat: python 3.12 * fix: add jupyter --- .github/workflows/codeql.yml | 34 +++++++++++++++++++++++++++++++ .github/workflows/commitlint.yaml | 4 ++-- .github/workflows/publish.yaml | 4 ++-- .github/workflows/test.yaml | 22 +++++++++++--------- .pre-commit-config.yaml | 12 +++++------ README.md | 2 +- pyproject.toml | 2 +- setup.py | 9 ++++---- tests/test_cli.py | 1 + 9 files changed, 64 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..eb3711c --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,34 @@ +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: python + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/commitlint.yaml b/.github/workflows/commitlint.yaml index d63f5a2..f5ce092 100644 --- a/.github/workflows/commitlint.yaml +++ b/.github/workflows/commitlint.yaml @@ -9,12 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.10" diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2c88013..081d138 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.10" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a8075a2..12424f3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.10" @@ -42,10 +42,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.10" @@ -62,14 +62,16 @@ jobs: strategy: matrix: - os: [ubuntu-latest, macos-latest] # eventually add `windows-latest` - python-version: [3.8, 3.9, "3.10", "3.11"] + # TODO: Replace with macos-latest when works again. + # https://github.com/actions/setup-python/issues/808 + os: [ubuntu-latest, macos-12] # eventually add `windows-latest` + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -86,10 +88,10 @@ jobs: # fail-fast: true # # steps: -# - uses: actions/checkout@v3 +# - uses: actions/checkout@v4 # # - name: Setup Python -# uses: actions/setup-python@v4 +# uses: actions/setup-python@v5 # with: # python-version: "3.10" # diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b659b53..fb13446 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,27 +1,27 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-yaml - - repo: https://github.com/pre-commit/mirrors-isort - rev: v5.10.1 + - repo: https://github.com/PyCQA/isort + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 24.4.2 hooks: - id: black name: black - repo: https://github.com/pycqa/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.7.0 + rev: v1.10.0 hooks: - id: mypy additional_dependencies: [types-setuptools, pydantic] diff --git a/README.md b/README.md index e9b6f6f..d74447b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Instantiate a Jupyter Notebook with Ape! ## Dependencies -- [python3](https://www.python.org/downloads) version 3.8 up to 3.11. +- [python3](https://www.python.org/downloads) version 3.8 up to 3.12. ## Installation diff --git a/pyproject.toml b/pyproject.toml index 4d9e811..99e1f4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ write_to = "ape_notebook/version.py" [tool.black] line-length = 100 -target-version = ['py37', 'py38', 'py39', 'py310','py311'] +target-version = ['py37', 'py38', 'py39', 'py310','py311', 'py312'] include = '\.pyi?$' [tool.pytest.ini_options] diff --git a/setup.py b/setup.py index e11d56f..cb47ad0 100644 --- a/setup.py +++ b/setup.py @@ -10,11 +10,11 @@ "hypothesis>=6.2.0,<7.0", # Strategy-based fuzzer ], "lint": [ - "black>=23.11.0,<24", # Auto-formatter and linter - "mypy>=1.7.0,<2", # Static type analyzer + "black>=24.4.2,<25", # Auto-formatter and linter + "mypy>=1.10.0,<2", # Static type analyzer "types-setuptools", # Needed for mypy type shed - "flake8>=6.1.0,<7", # Style linter - "isort>=5.10.1,<6", # Import sorting linter + "flake8>=7.0.0,<8", # Style linter + "isort>=5.13.2,<6", # Import sorting linter "mdformat>=0.7.17", # Auto-formatter for markdown "mdformat-gfm>=0.3.5", # Needed for formatting GitHub-flavored markdown "mdformat-frontmatter>=0.4.1", # Needed for frontmatters-style headers in issue templates @@ -87,5 +87,6 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ], ) diff --git a/tests/test_cli.py b/tests/test_cli.py index 44b5913..43d587f 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,4 +1,5 @@ """Test the CLI script.""" + import unittest from unittest.mock import MagicMock, patch