Skip to content

Commit 811c105

Browse files
committed
initial commit
0 parents  commit 811c105

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+8796
-0
lines changed

.darglint

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[darglint]
2+
docstring_style = google
3+
strictness = long

.flake8

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[flake8]
2+
select = B,B9,C,D,DAR,E,F,N,RST,S,W
3+
ignore = E203,E501,RST201,RST203,RST301,W503
4+
max-line-length = 80
5+
max-complexity = 10
6+
docstring-convention = google
7+
rst-roles = class,const,func,meth,mod,ref
8+
rst-directives = deprecated
9+
10+
per-file-ignores =
11+
tests/*:S101
12+
src/mdio/segy/_standards_rev0.py:B950
13+
src/mdio/segy/ebcdic.py:B950

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
- package-ecosystem: pip
8+
directory: "/.github/workflows"
9+
schedule:
10+
interval: daily
11+
- package-ecosystem: pip
12+
directory: "/docs"
13+
schedule:
14+
interval: daily
15+
- package-ecosystem: pip
16+
directory: "/"
17+
schedule:
18+
interval: daily
19+
versioning-strategy: lockfile-only
20+
allow:
21+
- dependency-type: "all"

.github/labels.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
# Labels names are important as they are used by Release Drafter to decide
3+
# regarding where to record them in changelog or if to skip them.
4+
#
5+
# The repository labels will be automatically configured using this file and
6+
# the GitHub Action https://github.com/marketplace/actions/github-labeler.
7+
- name: breaking
8+
description: Breaking Changes
9+
color: bfd4f2
10+
- name: bug
11+
description: Something isn't working
12+
color: d73a4a
13+
- name: build
14+
description: Build System and Dependencies
15+
color: bfdadc
16+
- name: ci
17+
description: Continuous Integration
18+
color: 4a97d6
19+
- name: dependencies
20+
description: Pull requests that update a dependency file
21+
color: 0366d6
22+
- name: documentation
23+
description: Improvements or additions to documentation
24+
color: 0075ca
25+
- name: duplicate
26+
description: This issue or pull request already exists
27+
color: cfd3d7
28+
- name: enhancement
29+
description: New feature or request
30+
color: a2eeef
31+
- name: github_actions
32+
description: Pull requests that update Github_actions code
33+
color: "000000"
34+
- name: good first issue
35+
description: Good for newcomers
36+
color: 7057ff
37+
- name: help wanted
38+
description: Extra attention is needed
39+
color: 008672
40+
- name: invalid
41+
description: This doesn't seem right
42+
color: e4e669
43+
- name: performance
44+
description: Performance
45+
color: "016175"
46+
- name: python
47+
description: Pull requests that update Python code
48+
color: 2b67c6
49+
- name: question
50+
description: Further information is requested
51+
color: d876e3
52+
- name: refactoring
53+
description: Refactoring
54+
color: ef67c4
55+
- name: removal
56+
description: Removals and Deprecations
57+
color: 9ae7ea
58+
- name: style
59+
description: Style
60+
color: c120e5
61+
- name: testing
62+
description: Testing
63+
color: b1fc6f
64+
- name: wontfix
65+
description: This will not be worked on
66+
color: ffffff

.github/release-drafter.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
categories:
2+
- title: ":boom: Breaking Changes"
3+
label: "breaking"
4+
- title: ":rocket: Features"
5+
label: "enhancement"
6+
- title: ":fire: Removals and Deprecations"
7+
label: "removal"
8+
- title: ":beetle: Fixes"
9+
label: "bug"
10+
- title: ":racehorse: Performance"
11+
label: "performance"
12+
- title: ":rotating_light: Testing"
13+
label: "testing"
14+
- title: ":construction_worker: Continuous Integration"
15+
label: "ci"
16+
- title: ":books: Documentation"
17+
label: "documentation"
18+
- title: ":hammer: Refactoring"
19+
label: "refactoring"
20+
- title: ":lipstick: Style"
21+
label: "style"
22+
- title: ":package: Dependencies"
23+
labels:
24+
- "dependencies"
25+
- "build"
26+
template: |
27+
## Changes
28+
29+
$CHANGES

.github/workflows/constraints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pip==22.2.2
2+
nox==2022.8.7
3+
nox-poetry==1.0.1
4+
poetry==1.2.0b3
5+
virtualenv==20.16.3

.github/workflows/labeler.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Labeler
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
jobs:
10+
labeler:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out the repository
14+
uses: actions/checkout@v3
15+
16+
- name: Run Labeler
17+
uses: crazy-max/[email protected]
18+
with:
19+
skip-delete: true

.github/workflows/release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
jobs:
10+
release:
11+
name: Release
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out the repository
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 2
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: "3.10"
23+
24+
- name: Upgrade pip
25+
run: |
26+
pip install --constraint=.github/workflows/constraints.txt pip
27+
pip --version
28+
29+
- name: Install Poetry
30+
run: |
31+
pip install --constraint=.github/workflows/constraints.txt poetry
32+
poetry --version
33+
34+
- name: Check if there is a parent commit
35+
id: check-parent-commit
36+
run: |
37+
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"
38+
39+
- name: Detect and tag new version
40+
id: check-version
41+
if: steps.check-parent-commit.outputs.sha
42+
uses: salsify/[email protected]
43+
with:
44+
version-command: |
45+
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
46+
47+
- name: Bump version for developmental release
48+
if: "! steps.check-version.outputs.tag"
49+
run: |
50+
poetry version patch &&
51+
version=$(poetry version | awk '{ print $2 }') &&
52+
poetry version $version.dev.$(date +%s)
53+
54+
- name: Build package
55+
run: |
56+
poetry build --ansi
57+
58+
- name: Publish package on PyPI
59+
if: steps.check-version.outputs.tag
60+
uses: pypa/[email protected]
61+
with:
62+
user: __token__
63+
password: ${{ secrets.PYPI_TOKEN }}
64+
65+
- name: Publish package on TestPyPI
66+
if: "! steps.check-version.outputs.tag"
67+
uses: pypa/[email protected]
68+
with:
69+
user: __token__
70+
password: ${{ secrets.TEST_PYPI_TOKEN }}
71+
repository_url: https://test.pypi.org/legacy/
72+
73+
- name: Publish the release notes
74+
uses: release-drafter/[email protected]
75+
with:
76+
publish: ${{ steps.check-version.outputs.tag != '' }}
77+
tag: ${{ steps.check-version.outputs.tag }}
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tests.yml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
name: Tests
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
tests:
9+
name: ${{ matrix.session }} ${{ matrix.python }} / ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- { python: "3.10", os: "ubuntu-latest", session: "pre-commit" }
16+
- { python: "3.10", os: "ubuntu-latest", session: "safety" }
17+
# - { python: "3.10", os: "ubuntu-latest", session: "mypy" }
18+
# - { python: "3.9", os: "ubuntu-latest", session: "mypy" }
19+
# - { python: "3.8", os: "ubuntu-latest", session: "mypy" }
20+
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
21+
- { python: "3.9", os: "ubuntu-latest", session: "tests" }
22+
- { python: "3.8", os: "ubuntu-latest", session: "tests" }
23+
- { python: "3.10", os: "windows-latest", session: "tests" }
24+
- { python: "3.10", os: "macos-latest", session: "tests" }
25+
# - { python: "3.10", os: "ubuntu-latest", session: "typeguard" }
26+
# - { python: "3.10", os: "ubuntu-latest", session: "xdoctest" }
27+
- { python: "3.10", os: "ubuntu-latest", session: "docs-build" }
28+
29+
env:
30+
NOXSESSION: ${{ matrix.session }}
31+
FORCE_COLOR: "1"
32+
PRE_COMMIT_COLOR: "always"
33+
34+
steps:
35+
- name: Check out the repository
36+
uses: actions/checkout@v3
37+
38+
- name: Set up Python ${{ matrix.python }}
39+
uses: actions/setup-python@v3
40+
with:
41+
python-version: ${{ matrix.python }}
42+
43+
- name: Upgrade pip
44+
run: |
45+
pip install --constraint=.github/workflows/constraints.txt pip
46+
pip --version
47+
48+
- name: Upgrade pip in virtual environments
49+
shell: python
50+
run: |
51+
import os
52+
import pip
53+
54+
with open(os.environ["GITHUB_ENV"], mode="a") as io:
55+
print(f"VIRTUALENV_PIP={pip.__version__}", file=io)
56+
57+
- name: Install Poetry
58+
run: |
59+
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
60+
poetry --version
61+
62+
- name: Install Nox
63+
run: |
64+
pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox
65+
pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry
66+
nox --version
67+
68+
- name: Compute pre-commit cache key
69+
if: matrix.session == 'pre-commit'
70+
id: pre-commit-cache
71+
shell: python
72+
run: |
73+
import hashlib
74+
import sys
75+
76+
python = "py{}.{}".format(*sys.version_info[:2])
77+
payload = sys.version.encode() + sys.executable.encode()
78+
digest = hashlib.sha256(payload).hexdigest()
79+
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8])
80+
81+
print("::set-output name=result::{}".format(result))
82+
83+
- name: Restore pre-commit cache
84+
uses: actions/cache@v3
85+
if: matrix.session == 'pre-commit'
86+
with:
87+
path: ~/.cache/pre-commit
88+
key: ${{ steps.pre-commit-cache.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }}
89+
restore-keys: |
90+
${{ steps.pre-commit-cache.outputs.result }}-
91+
92+
- name: Run Nox
93+
run: |
94+
nox --python=${{ matrix.python }}
95+
96+
- name: Upload coverage data
97+
if: always() && matrix.session == 'tests'
98+
uses: "actions/upload-artifact@v3"
99+
with:
100+
name: coverage-data
101+
path: ".coverage.*"
102+
103+
- name: Upload documentation
104+
if: matrix.session == 'docs-build'
105+
uses: actions/upload-artifact@v3
106+
with:
107+
name: docs
108+
path: docs/_build
109+
110+
coverage:
111+
runs-on: ubuntu-latest
112+
needs: tests
113+
steps:
114+
- name: Check out the repository
115+
uses: actions/checkout@v3
116+
117+
- name: Set up Python
118+
uses: actions/setup-python@v3
119+
with:
120+
python-version: "3.10"
121+
122+
- name: Upgrade pip
123+
run: |
124+
pip install --constraint=.github/workflows/constraints.txt pip
125+
pip --version
126+
127+
- name: Install Poetry
128+
run: |
129+
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
130+
poetry --version
131+
132+
- name: Install Nox
133+
run: |
134+
pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox
135+
pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry
136+
nox --version
137+
138+
- name: Download coverage data
139+
uses: actions/download-artifact@v3
140+
with:
141+
name: coverage-data
142+
143+
- name: Combine coverage data and display human readable report
144+
run: |
145+
nox --session=coverage
146+
147+
- name: Create coverage report
148+
run: |
149+
nox --session=coverage -- xml
150+
151+
- name: Upload coverage report
152+
uses: codecov/[email protected]

0 commit comments

Comments
 (0)