Skip to content

Commit cb4beaa

Browse files
committed
ENH: Initial commit
0 parents  commit cb4beaa

File tree

19 files changed

+1364
-0
lines changed

19 files changed

+1364
-0
lines changed

.github/pull_request_template.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Resolves #issue
2+
3+
Briefly describe changes here, e.g. "Added a precise description about the
4+
changes made to the code, and what the PR is solving."
5+
6+
## Checklist
7+
8+
- [ ] Tests added (if not, comment why)
9+
- [ ] Test coverage equal or up from main (run pytest with `--cov=<packagename> --cov-report term-missing`)
10+
- [ ] If not squash merging, every commit passes tests
11+
- [ ] Appropriate [commit prefix](https://upgraded-funicular-eywe4gy.pages.github.io/developing/#commit-prefixes) and precise commit message used
12+
- [ ] All debug prints and unnecessary comments removed
13+
- [ ] Docstrings are correct and updated
14+
- [ ] Documentation is updated, if necessary
15+
- [ ] Latest main rebased/merged into branch
16+
- [ ] Added comments on this PR where appropriate to help reviewers
17+
- [ ] Moved issue status on project board
18+
- [ ] Checked the boxes in this checklist ✅

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
release:
11+
types:
12+
- published
13+
schedule:
14+
# Run nightly to check that tests are working with latest dependencies
15+
- cron: "0 0 * * *"
16+
17+
jobs:
18+
check-rmsenv:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
python-version: ["3.11", "3.12"]
23+
24+
steps:
25+
- name: Checkout commit locally
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Install rmsenv with dependencies
36+
if: ${{ always() }}
37+
run: |
38+
pip install -U pip
39+
pip install -e ".[dev]"
40+
41+
- name: List all installed packages
42+
run: pip freeze
43+
44+
- name: Ruff check
45+
if: ${{ always() }}
46+
run: ruff check
47+
48+
- name: Ruff format
49+
if: ${{ always() }}
50+
run: ruff format --check
51+
52+
- name: Check typing with mypy
53+
if: ${{ always() }}
54+
run: mypy src tests
55+
56+
- name: Run tests
57+
if: ${{ always() }}
58+
run: pytest -n auto tests --cov=fmu-settings-api --cov-report term-missing

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
# Disabled until if/when it becomes open source.
6+
# release:
7+
# types: [published]
8+
9+
jobs:
10+
pypi-publish:
11+
name: Upload release to PyPI
12+
runs-on: ubuntu-latest
13+
environment:
14+
name: pypi
15+
url: https://pypi.org/p/fmu-settings-cli
16+
permissions:
17+
id-token: write
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Set up Python 3.11
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: 3.11
29+
30+
- name: Install build dependencies
31+
run: |
32+
pip install -U pip
33+
pip install build
34+
35+
- name: Build distributions
36+
run: python -m build
37+
38+
- name: Publish package distributions to PyPI
39+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# Distribution / packaging
7+
.Python
8+
build/
9+
develop-eggs/
10+
dist/
11+
downloads/
12+
eggs/
13+
.eggs/
14+
lib/
15+
lib64/
16+
parts/
17+
sdist/
18+
var/
19+
wheels/
20+
pip-wheel-metadata/
21+
share/python-wheels/
22+
*.egg-info/
23+
.installed.cfg
24+
*.egg
25+
MANIFEST
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.nox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
*.py,cover
48+
.hypothesis/
49+
.pytest_cache/
50+
51+
# Sphinx documentation
52+
docs/_build/
53+
54+
# PyBuilder
55+
target/
56+
57+
# Jupyter Notebook
58+
.ipynb_checkpoints
59+
60+
# IPython
61+
profile_default/
62+
ipython_config.py
63+
64+
# pyenv
65+
.python-version
66+
67+
# pipenv
68+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
69+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
70+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
71+
# install all needed dependencies.
72+
#Pipfile.lock
73+
74+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
75+
__pypackages__/
76+
77+
# Environments
78+
.env
79+
.venv
80+
env/
81+
venv/
82+
ENV/
83+
env.bak/
84+
venv.bak/
85+
86+
87+
# Rope project settings
88+
.ropeproject
89+
90+
# mkdocs documentation
91+
/site
92+
93+
# vscode
94+
.vscode/
95+
96+
# setuptools_scm version
97+
src/fmu/settings/_version.py
98+
.mypy_cache/

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Contributing
2+
3+
This document contains information for contributing to this project.
4+
All contributions are welcome!
5+
6+
## Developing
7+
8+
Clone and install into a virtual environment.
9+
10+
```sh
11+
git clone git@github.com:equinor/fmu-settings-cli.git
12+
cd fmu-settings-cli
13+
# Create or source virtual/Komodo env
14+
pip install -U pip
15+
pip install -e ".[dev]"
16+
# Make a feature branch for your changes
17+
git checkout -b some-feature-branch
18+
```
19+
20+
Run the tests with
21+
22+
```sh
23+
pytest -n auto tests
24+
```
25+
26+
Ensure your changes will pass the various linters before making a pull
27+
request. It is expected that all code will be typed and validated with
28+
mypy.
29+
30+
```sh
31+
ruff check
32+
ruff format --check
33+
mypy src tests
34+
```

0 commit comments

Comments
 (0)