diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..eb4df8f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +--- +name: CI + +"on": + push: + branches: [master, main] + pull_request: + branches: [master, main] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + 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 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 ''"