Skip to content

Commit 8828db2

Browse files
authored
Merge pull request #47 from statisticsnorway/testing_efr
Test functions and minor changes
2 parents 93a8265 + e23c31f commit 8828db2

16 files changed

+940
-166
lines changed

.gitignore

+82-15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
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+
*.csv
10+
*.db
11+
*.feather
12+
*.parquet
13+
*.sas7bdat
14+
*.xls
15+
*.xlsx
16+
*.zip
17+
18+
# The section below is from the GitHub .gitignore template for Python:
19+
# https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
20+
121
# Byte-compiled / optimized / DLL files
222
__pycache__/
323
*.py[cod]
@@ -21,7 +41,6 @@ parts/
2141
sdist/
2242
var/
2343
wheels/
24-
pip-wheel-metadata/
2544
share/python-wheels/
2645
*.egg-info/
2746
.installed.cfg
@@ -84,15 +103,11 @@ target/
84103
profile_default/
85104
ipython_config.py
86105

87-
# pyenv
88-
.python-version
89-
90-
# pipenv
91-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94-
# install all needed dependencies.
95-
#Pipfile.lock
106+
# pdm
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
96111

97112
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
98113
__pypackages__/
@@ -131,9 +146,61 @@ dmypy.json
131146
# Pyre type checker
132147
.pyre/
133148

134-
# PyCharm
135-
.idea/
149+
# pytype static type analyzer
150+
.pytype/
151+
152+
# Cython debug symbols
153+
cython_debug/
154+
155+
# The section below is from the GitHub .gitignore template for R:
156+
# https://raw.githubusercontent.com/github/gitignore/main/R.gitignore
157+
158+
# History files
159+
.Rhistory
160+
.Rapp.history
161+
162+
# Session Data files
163+
.RData
164+
.RDataTmp
165+
166+
# User-specific files
167+
.Ruserdata
168+
169+
# Example code in package build process
170+
*-Ex.R
171+
172+
# Output files from R CMD build
173+
/*.tar.gz
174+
175+
# Output files from R CMD check
176+
/*.Rcheck/
177+
178+
# RStudio files
179+
.Rproj.user/
180+
181+
# produced vignettes
182+
vignettes/*.html
183+
vignettes/*.pdf
184+
185+
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
186+
.httr-oauth
187+
188+
# knitr and R markdown default cache directories
189+
*_cache/
190+
/cache/
191+
192+
# Temporary files created by R markdown
193+
*.utf8.md
194+
*.knit.md
195+
196+
# R Environment Variables
197+
.Renviron
198+
199+
# translation temp files
200+
po/*~
201+
202+
# RStudio Connect folder
203+
rsconnect/
136204

137-
/.python-version
138-
/.pytype/
139-
/docs/_build/
205+
# ignore poetry in .config
206+
.poetry/**

poetry.lock

+104-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "ssb-utdanning"
3-
version = "0.0.1"
3+
version = "0.0.2"
44
description = "SSB Utdanning Fellesfunksjoner"
55
authors = ["Carl F. Corneil <[email protected]>"]
66
license = "MIT"
@@ -23,6 +23,8 @@ ssb-fagfunksjoner = ">=0.1.0"
2323
pandas-stubs = ">=2.1.1.230928"
2424
types-python-dateutil = ">=2.8.19.14"
2525
types-toml = ">=0.10.8.7"
26+
nox = "^2023.4.22"
27+
nox-poetry = "^1.0.3"
2628

2729
[tool.poetry.group.dev.dependencies]
2830
pygments = ">=2.10.0"
@@ -44,6 +46,8 @@ xdoctest = { extras = ["colors"], version = ">=0.15.10" }
4446
myst-parser = { version = ">=0.16.1" }
4547
ipykernel = ">=6.0.0"
4648

49+
50+
4751
[tool.pytest.ini_options]
4852
pythonpath = ["src"]
4953

@@ -78,7 +82,7 @@ ignore_missing_imports = true
7882
[tool.ruff]
7983
force-exclude = true # Apply excludes to pre-commit
8084
show-fixes = true
81-
src = ["src", "tests"]
85+
src = ["src"]
8286
target-version = "py39" # Minimum Python version supported
8387

8488
# Ruff rules may be customized as desired: https://docs.astral.sh/ruff/rules/
@@ -106,6 +110,7 @@ extend-exclude = [
106110
".ipynb_checkpoints",
107111
"noxfile.py",
108112
"docs/conf.py",
113+
"tests"
109114
]
110115

111116
[tool.ruff.isort]

src/ssb_utdanning/config.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
MOCKING (bool): Whether the application is running in mocking mode.
77
PROD_FORMATS_PATH (str): The path to the production formats.
88
"""
9+
import os
910

10-
11-
MILJO = "PROD"
1211
TESTING = False
1312
MOCKING = False
13+
14+
ENVIR = os.environ.get("DAPLA_ENVIRONMENT", "TEST")
15+
SERVICE = os.environ.get("DAPLA_SERVICE", "JUPYTERLAB")
16+
REGION = os.environ.get("DAPLA_REGION", "ON_PREM")
17+
1418
PROD_FORMATS_PATH = "/ssb/stamme01/utd/utd-felles/formater/"
19+
DATETIME_FORMAT = "%Y-%m-%dT%H-%M-%S"

0 commit comments

Comments
 (0)