From acd8548a0cc7ac8f5a223ce60587d27196dbfc36 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 26 May 2025 12:04:58 +0000 Subject: [PATCH 1/2] Add workflow for running CI --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5bb9406 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: [ master, main ] + pull_request: + branches: [ master, main ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e . + pip install ruff pytest + + - name: Run ruff format check + run: ruff format --check . + + - name: Run ruff lint + run: ruff check . + + - name: Run tests + run: | + # Run pytest if test files exist, otherwise just import the module + if [ -d "tests" ] || find . -name "*test*.py" -type f | grep -q .; then + pytest + else + python -c "import sphinxcontrib.googleanalytics; print('Module import successful')" + fi \ No newline at end of file From 0827bdc47ecae2803fd279ea47da9b4df9315383 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 26 May 2025 14:48:38 +0000 Subject: [PATCH 2/2] Fix pyproject.toml --- .github/workflows/ci.yml | 63 ++++++++++++++++++++-------------------- pyproject.toml | 10 +------ 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bb9406..eb4df8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,43 +1,44 @@ +--- name: CI -on: +"on": push: - branches: [ master, main ] + branches: [master, main] pull_request: - branches: [ master, main ] + branches: [master, main] jobs: test: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -e . - pip install ruff pytest - - - name: Run ruff format check - run: ruff format --check . - - - name: Run ruff lint - run: ruff check . - - - name: Run tests - run: | - # Run pytest if test files exist, otherwise just import the module - if [ -d "tests" ] || find . -name "*test*.py" -type f | grep -q .; then - pytest - else - python -c "import sphinxcontrib.googleanalytics; print('Module import successful')" - fi \ No newline at end of file + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e . + pip install ruff pytest + + - name: Run ruff format check + run: ruff format --check . + + - name: Run ruff lint + run: ruff check . + + - name: Run tests + run: | + # Run pytest if test files exist, otherwise just import the module + if [ -d "tests" ] || find . -name "*test*.py" -type f | grep -q .; then + pytest + else + python -c "import sphinxcontrib.googleanalytics; print('Module import successful')" + fi diff --git a/pyproject.toml b/pyproject.toml index bf2e2cc..c4aff12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "sphinxcontrib-googleanalytics" version = "0.4" -license = {text = "BSD"} +license = "BSD-3-Clause" authors = [{name = "Domen Kozar", email = "domen@dev.si"}] maintainers = [{name = "Jelmer Vernooij", email = "jelmer@jelmer.uk"}] description = "Sphinx extension googleanalytics" @@ -15,7 +15,6 @@ classifiers = [ "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", - "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Documentation", @@ -31,15 +30,8 @@ Repository = "https://github.com/sphinx-contrib/googleanalytics" [tool.setuptools] zip-safe = false include-package-data = true -namespace-packages = ["sphinxcontrib"] platforms = ["any"] [tool.setuptools.packages] find = {namespaces = false} -[tool.distutils.egg_info] -tag-build = "dev" -tag-date = true - -[tool.aliases] -release = "egg_info -RDb ''"