Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"template": "https://github.com/statisticsnorway/ssb-pypitemplate.git",
"commit": "364d8a1371f3eefd7228f0189126db6ba96e76ee",
"checkout": "2024.11.26",
"commit": "0d33fca0d1c29c79aef9c7053e36d9e7cdd2bd20",
"checkout": "2025.2.19",
"context": {
"cookiecutter": {
"project_name": "ssb-konjunk",
Expand All @@ -23,7 +23,8 @@
"lstrip_blocks": true,
"trim_blocks": true
},
"_template": "https://github.com/statisticsnorway/ssb-pypitemplate.git"
"_template": "https://github.com/statisticsnorway/ssb-pypitemplate.git",
"_commit": "0d33fca0d1c29c79aef9c7053e36d9e7cdd2bd20"
}
},
"directory": null
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pip==24.3.1
nox==2024.10.9
nox-poetry==1.0.3
poetry==1.8.4
virtualenv==20.28.0
pip==25.0.1
nox==2025.2.9
nox-poetry==1.1.0
poetry==2.1.1
virtualenv==20.29.2
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ jobs:
- name: Install Poetry
run: |
pipx install --pip-args "-c ${{ github.workspace }}/.github/workflows/constraints.txt" poetry
pipx inject poetry poetry-plugin-export
poetry --version

- name: Set up Python
uses: actions/setup-python@v5.3.0
uses: actions/setup-python@v5.4.0
with:
python-version: "3.12"
cache: "poetry"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
uses: actions/checkout@v4

- name: Run Labeler
uses: crazy-max/ghaction-github-labeler@v5.1.0
uses: crazy-max/ghaction-github-labeler@v5.2.0
with:
skip-delete: true
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v5.3.0
uses: actions/setup-python@v5.4.0
with:
python-version: "3.12"

Expand All @@ -32,7 +32,8 @@ jobs:

- name: Install Poetry
run: |
pip install -c ${{ github.workspace }}/.github/workflows/constraints.txt poetry
pipx install --pip-args "-c ${{ github.workspace }}/.github/workflows/constraints.txt" poetry
pipx inject poetry poetry-plugin-export
poetry --version

- name: Check if there is a parent commit
Expand Down Expand Up @@ -61,16 +62,16 @@ jobs:

- name: Publish package on PyPI
if: steps.check-version.outputs.tag
uses: pypa/gh-action-pypi-publish@v1.12.2
uses: pypa/gh-action-pypi-publish@v1.12.4

- name: Publish package on TestPyPI
if: (!steps.check-version.outputs.tag)
uses: pypa/gh-action-pypi-publish@v1.12.2
uses: pypa/gh-action-pypi-publish@v1.12.4
with:
repository-url: https://test.pypi.org/legacy/

- name: Publish the release notes
uses: release-drafter/release-drafter@v6.0.0
uses: release-drafter/release-drafter@v6.1.0
with:
publish: ${{ steps.check-version.outputs.tag != '' }}
tag: ${{ steps.check-version.outputs.tag }}
Expand Down
32 changes: 17 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@ jobs:
fail-fast: false
matrix:
include:
- { python: "3.10", os: "ubuntu-latest", session: "pre-commit" }
- { python: "3.10", os: "ubuntu-latest", session: "mypy" }
- { python: "3.11", os: "ubuntu-latest", session: "pre-commit" }
- { python: "3.11", os: "ubuntu-latest", session: "mypy" }
- { python: "3.12", os: "ubuntu-latest", session: "mypy" }
- { python: "3.13", os: "ubuntu-latest", session: "mypy" }
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
- { python: "3.11", os: "ubuntu-latest", session: "tests" }
- { python: "3.12", os: "ubuntu-latest", session: "tests" }
- { python: "3.12", os: "windows-latest", session: "tests" }
- { python: "3.12", os: "macos-latest", session: "tests" }
- { python: "3.10", os: "ubuntu-latest", session: "typeguard" }
- { python: "3.10", os: "ubuntu-latest", session: "xdoctest" }
- { python: "3.10", os: "ubuntu-latest", session: "docs-build" }
- { python: "3.13", os: "ubuntu-latest", session: "tests" }
- { python: "3.13", os: "windows-latest", session: "tests" }
- { python: "3.13", os: "macos-latest", session: "tests" }
- { python: "3.11", os: "ubuntu-latest", session: "typeguard" }
- { python: "3.11", os: "ubuntu-latest", session: "xdoctest" }
- { python: "3.11", os: "ubuntu-latest", session: "docs-build" }

env:
NOXSESSION: ${{ matrix.session }}
Expand All @@ -38,7 +39,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5.3.0
uses: actions/setup-python@v5.4.0
with:
python-version: ${{ matrix.python }}

Expand All @@ -59,6 +60,7 @@ jobs:
- name: Install Poetry
run: |
pipx install --pip-args "-c ${{ github.workspace }}/.github/workflows/constraints.txt" poetry
pipx inject poetry poetry-plugin-export
poetry --version

- name: Install Nox
Expand Down Expand Up @@ -121,9 +123,9 @@ jobs:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up Python
uses: actions/setup-python@v5.3.0
uses: actions/setup-python@v5.4.0
with:
python-version: "3.12"
python-version: "3.11"

- name: Upgrade pip
run: |
Expand All @@ -133,6 +135,7 @@ jobs:
- name: Install Poetry
run: |
pipx install --pip-args "-c ${{ github.workspace }}/.github/workflows/constraints.txt" poetry
pipx inject poetry poetry-plugin-export
poetry --version

- name: Install Nox
Expand All @@ -159,13 +162,12 @@ jobs:
# Replace root path with /github/workspace (mounted in docker container).
- name: Override coverage source paths for SonarCloud
run: |
sed -i "s/<source><\/source>/<source>\/github\/workspace<\/source>/g" coverage.xml
sed -i "s/<source>tests/<source>\/github\/workspace\/tests/g" coverage.xml
sed -i "s/<source><\/source>/<source>\/home\/runner\/work\/ssb-konjunk\/ssb-konjunk<\/source>/g" coverage.xml
sed -i "s/<source>tests/<source>\/home\/runner\/work\/ssb-konjunk\/ssb-konjunk\/tests/g" coverage.xml

- name: SonarCloud Scan
- name: SonarQube Cloud Scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# No need to run SonarCloud analysis if dependabot update or token not defined
if: env.SONAR_TOKEN != '' && (github.actor != 'dependabot[bot]')
uses: SonarSource/sonarcloud-github-action@v3.1.0
uses: SonarSource/sonarqube-scan-action@v5.0.0
72 changes: 63 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,29 @@

# The section below contains SSB specific ignores, not included in the Python-
# and R-ignores from GitHub.

*.csv
*.db
*.feather
*.gz
*.orig
*.parquet
*.sas7bdat
*.xls
*.xlsx
*.zip
*.rda
*.rej

# Blaise
*.bdix
*.bdbx
*.bpkg
*.mbpkg
*.backup
*.bmix
*.msux
*.usersettings

# Notebooks shall be stored in .py or .R-format.
# See https://adr.ssb.no/0020-lagringsformat-for-jupyter-notebooks/
Expand All @@ -27,7 +42,7 @@
__pycache__/
*.py[cod]
*$py.class
.poetry/cache/
**/.poetry/cache/

# C extensions
*.so
Expand Down Expand Up @@ -108,11 +123,40 @@ target/
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
Expand Down Expand Up @@ -157,6 +201,19 @@ dmypy.json
# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Ruff stuff:
.ruff_cache/

# PyPI configuration file
.pypirc

# The section below is from the GitHub .gitignore template for R:
# https://raw.githubusercontent.com/github/gitignore/main/R.gitignore

Expand Down Expand Up @@ -201,15 +258,12 @@ vignettes/*.pdf
# R Environment Variables
.Renviron

# pkgdown site
# SSB: The directory below is commented out because default when generating documentation with Sphinx
#docs/

# translation temp files
po/*~

# RStudio Connect folder
rsconnect/

# ignore poetry in .config
.poetry/**

# Blaise specific ignores
*.bdix
*.bdbx
5 changes: 3 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
raise SystemExit(dedent(message)) from None

package = "ssb_konjunk"
python_versions = ["3.10", "3.11", "3.12"]
python_versions = ["3.11", "3.12", "3.13"]
python_versions_for_test = python_versions + ["3.10"]
nox.needs_version = ">= 2021.6.6"
nox.options.sessions = (
"pre-commit",
Expand Down Expand Up @@ -150,7 +151,7 @@ def mypy(session: Session) -> None:
session.run("mypy", f"--python-executable={sys.executable}", "noxfile.py")


@session(python=python_versions)
@session(python=python_versions_for_test)
def tests(session: Session) -> None:
"""Run the test suite."""
session.install(".")
Expand Down
Loading
Loading