Skip to content

Commit 4da95b6

Browse files
authored
Merge pull request #32 from statisticsnorway/fix-year
Fix for when time variable is year
2 parents 4c30354 + 630c033 commit 4da95b6

File tree

12 files changed

+734
-457
lines changed

12 files changed

+734
-457
lines changed

.cookiecutter.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"code_quality_level": "High",
1212
"copyright_owner": "Statistics Norway",
1313
"copyright_year": "2024",
14+
"department_number": "",
15+
"dependency_manager_tool": "poetry",
1416
"development_status": "Development Status :: 3 - Alpha",
1517
"email": "susie.jentoft@ssb.no",
1618
"friendly_name": "vaskify",

.cruft.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"template": "https://github.com/statisticsnorway/ssb-pypitemplate.git",
3-
"commit": "66884cffa5aa67ed505bb121009501b51cc4d847",
4-
"checkout": "2025.1.14",
3+
"commit": "9e3c49f6680d4c400567c39d70b768f0a322c95e",
4+
"checkout": "2025.7.18",
55
"context": {
66
"cookiecutter": {
77
"project_name": "ssb-vaskify",
@@ -16,6 +16,8 @@
1616
"license": "MIT",
1717
"development_status": "Development Status :: 3 - Alpha",
1818
"code_quality_level": "High",
19+
"dependency_manager_tool": "poetry",
20+
"department_number": "",
1921
"_copy_without_render": [
2022
"*.rst_t"
2123
],
@@ -24,7 +26,7 @@
2426
"trim_blocks": true
2527
},
2628
"_template": "https://github.com/statisticsnorway/ssb-pypitemplate.git",
27-
"_commit": "66884cffa5aa67ed505bb121009501b51cc4d847"
29+
"_commit": "9e3c49f6680d4c400567c39d70b768f0a322c95e"
2830
}
2931
},
3032
"directory": null

.github/workflows/constraints.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
pip==25.1
2-
nox==2025.2.9
1+
nox==2025.5.1
2+
pip==25.1.1
33
nox-poetry==1.2.0
4-
poetry==2.1.2
5-
virtualenv==20.30.0
4+
poetry==2.1.3

.github/workflows/tests.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- master
88
pull_request:
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
tests:
1215
name: ${{ matrix.session }} ${{ matrix.python }} / ${{ matrix.os }}
@@ -15,18 +18,19 @@ jobs:
1518
fail-fast: false
1619
matrix:
1720
include:
18-
- { python: "3.10", os: "ubuntu-latest", session: "pre-commit" }
19-
- { python: "3.10", os: "ubuntu-latest", session: "mypy" }
21+
- { python: "3.11", os: "ubuntu-latest", session: "pre-commit" }
2022
- { python: "3.11", os: "ubuntu-latest", session: "mypy" }
2123
- { python: "3.12", os: "ubuntu-latest", session: "mypy" }
24+
- { python: "3.13", os: "ubuntu-latest", session: "mypy" }
2225
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
2326
- { python: "3.11", os: "ubuntu-latest", session: "tests" }
2427
- { python: "3.12", os: "ubuntu-latest", session: "tests" }
25-
- { python: "3.12", os: "windows-latest", session: "tests" }
26-
- { python: "3.12", os: "macos-latest", session: "tests" }
27-
- { python: "3.10", os: "ubuntu-latest", session: "typeguard" }
28-
- { python: "3.10", os: "ubuntu-latest", session: "xdoctest" }
29-
- { python: "3.10", os: "ubuntu-latest", session: "docs-build" }
28+
- { python: "3.13", os: "ubuntu-latest", session: "tests" }
29+
- { python: "3.13", os: "windows-latest", session: "tests" }
30+
- { python: "3.13", os: "macos-latest", session: "tests" }
31+
- { python: "3.11", os: "ubuntu-latest", session: "typeguard" }
32+
- { python: "3.11", os: "ubuntu-latest", session: "xdoctest" }
33+
- { python: "3.11", os: "ubuntu-latest", session: "docs-build" }
3034

3135
env:
3236
NOXSESSION: ${{ matrix.session }}
@@ -124,7 +128,7 @@ jobs:
124128
- name: Set up Python
125129
uses: actions/setup-python@v5.6.0
126130
with:
127-
python-version: "3.10"
131+
python-version: "3.11"
128132

129133
- name: Upgrade pip
130134
run: |
@@ -170,4 +174,4 @@ jobs:
170174
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
171175
# No need to run SonarCloud analysis if dependabot update or token not defined
172176
if: env.SONAR_TOKEN != '' && (github.actor != 'dependabot[bot]')
173-
uses: SonarSource/sonarcloud-github-action@v5.0.0
177+
uses: SonarSource/sonarqube-scan-action@v5.2.0

.gitignore

Lines changed: 142 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,48 @@
1+
# This .gitignore file is based on SSB's recommended gitignore template stored
2+
# in: https://github.com/statisticsnorway/kvakk-git-tools
3+
# It contains three sections: SSB specific ignores, GitHub's Python-ignore
4+
# template and GitHub's R-ignore template.
5+
6+
7+
# The section below contains SSB specific ignores, not included in the Python-
8+
# and R-ignores from GitHub.
9+
10+
*.csv
11+
*.db
12+
*.feather
13+
*.gz
14+
*.orig
15+
*.parquet
16+
*.sas7bdat
17+
*.xls
18+
*.xlsx
19+
*.zip
20+
*.rda
21+
*.rej
22+
23+
# Blaise
24+
*.bdix
25+
*.bdbx
26+
*.bpkg
27+
*.mbpkg
28+
*.backup
29+
*.bmix
30+
*.msux
31+
*.usersettings
32+
33+
# Notebooks shall be stored in .py or .R-format.
34+
# See https://adr.ssb.no/0020-lagringsformat-for-jupyter-notebooks/
35+
*.ipynb
36+
37+
38+
# The section below is from the GitHub .gitignore template for Python:
39+
# https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
40+
141
# Byte-compiled / optimized / DLL files
242
__pycache__/
343
*.py[cod]
444
*$py.class
45+
**/.poetry/cache/
546

647
# C extensions
748
*.so
@@ -20,7 +61,6 @@ parts/
2061
sdist/
2162
var/
2263
wheels/
23-
pip-wheel-metadata/
2464
share/python-wheels/
2565
*.egg-info/
2666
.installed.cfg
@@ -50,6 +90,7 @@ coverage.xml
5090
*.py,cover
5191
.hypothesis/
5292
.pytest_cache/
93+
cover/
5394

5495
# Translations
5596
*.mo
@@ -72,6 +113,7 @@ instance/
72113
docs/_build/
73114

74115
# PyBuilder
116+
.pybuilder/
75117
target/
76118

77119
# Jupyter Notebook
@@ -82,7 +124,9 @@ profile_default/
82124
ipython_config.py
83125

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

87131
# pipenv
88132
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
@@ -91,7 +135,30 @@ ipython_config.py
91135
# install all needed dependencies.
92136
#Pipfile.lock
93137

94-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
138+
# UV
139+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
140+
# This is especially recommended for binary packages to ensure reproducibility, and is more
141+
# commonly ignored for libraries.
142+
#uv.lock
143+
144+
# poetry
145+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
146+
# This is especially recommended for binary packages to ensure reproducibility, and is more
147+
# commonly ignored for libraries.
148+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
149+
#poetry.lock
150+
151+
# pdm
152+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
153+
#pdm.lock
154+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
155+
# in version control.
156+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
157+
.pdm.toml
158+
.pdm-python
159+
.pdm-build/
160+
161+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
95162
__pypackages__/
96163

97164
# Celery stuff
@@ -103,6 +170,7 @@ celerybeat.pid
103170

104171
# Environments
105172
.env
173+
.envrc
106174
.venv
107175
env/
108176
venv/
@@ -128,21 +196,75 @@ dmypy.json
128196
# Pyre type checker
129197
.pyre/
130198

199+
# pytype static type analyzer
200+
.pytype/
201+
202+
# Cython debug symbols
203+
cython_debug/
204+
131205
# PyCharm
132-
.idea/
133-
134-
/.python-version
135-
/.pytype/
136-
/docs/_build/
137-
138-
# Visual Studio Code
139-
.vscode/*
140-
!.vscode/settings.json
141-
!.vscode/tasks.json
142-
!.vscode/launch.json
143-
!.vscode/extensions.json
144-
!.vscode/*.code-snippets
145-
# Local History for Visual Studio Code
146-
.history/
147-
# Built Visual Studio Code Extensions
148-
*.vsix
206+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
207+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
208+
# and can be added to the global gitignore or merged into this file. For a more nuclear
209+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
210+
#.idea/
211+
212+
# Ruff stuff:
213+
.ruff_cache/
214+
215+
# PyPI configuration file
216+
.pypirc
217+
218+
# The section below is from the GitHub .gitignore template for R:
219+
# https://raw.githubusercontent.com/github/gitignore/main/R.gitignore
220+
221+
# History files
222+
.Rhistory
223+
.Rapp.history
224+
225+
# Session Data files
226+
.RData
227+
.RDataTmp
228+
229+
# User-specific files
230+
.Ruserdata
231+
232+
# Example code in package build process
233+
*-Ex.R
234+
235+
# Output files from R CMD build
236+
/*.tar.gz
237+
238+
# Output files from R CMD check
239+
/*.Rcheck/
240+
241+
# RStudio files
242+
.Rproj.user/
243+
244+
# produced vignettes
245+
vignettes/*.html
246+
vignettes/*.pdf
247+
248+
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
249+
.httr-oauth
250+
251+
# knitr and R markdown default cache directories
252+
*_cache/
253+
/cache/
254+
255+
# Temporary files created by R markdown
256+
*.utf8.md
257+
*.knit.md
258+
259+
# R Environment Variables
260+
.Renviron
261+
262+
# pkgdown site
263+
# SSB: The directory below is commented out because default when generating documentation with Sphinx
264+
#docs/
265+
266+
# translation temp files
267+
po/*~
268+
269+
# RStudio Connect folder
270+
rsconnect/

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
[pypi status]: https://pypi.org/project/ssb-vaskify/
1919
[documentation]: https://statisticsnorway.github.io/ssb-vaskify
2020
[tests]: https://github.com/statisticsnorway/ssb-vaskify/actions?workflow=Tests
21-
2221
[sonarcov]: https://sonarcloud.io/summary/overall?id=statisticsnorway_ssb-vaskify
2322
[sonarquality]: https://sonarcloud.io/summary/overall?id=statisticsnorway_ssb-vaskify
2423
[pre-commit]: https://github.com/pre-commit/pre-commit

noxfile.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
raise SystemExit(dedent(message)) from None
2424

2525
package = "vaskify"
26-
python_versions = ["3.10", "3.11", "3.12"]
26+
python_versions = ["3.11", "3.12", "3.13"]
27+
python_versions_for_test = python_versions + ["3.10"]
2728
nox.needs_version = ">= 2021.6.6"
2829
nox.options.sessions = (
2930
"pre-commit",
@@ -150,7 +151,7 @@ def mypy(session: Session) -> None:
150151
session.run("mypy", f"--python-executable={sys.executable}", "noxfile.py")
151152

152153

153-
@session(python=python_versions)
154+
@session(python=python_versions_for_test)
154155
def tests(session: Session) -> None:
155156
"""Run the test suite."""
156157
session.install(".")

0 commit comments

Comments
 (0)