Skip to content

Commit 0ac1d40

Browse files
FIX: fixes on pyproject, requirements, workflows, environment
1 parent 7752215 commit 0ac1d40

10 files changed

Lines changed: 246 additions & 89 deletions

File tree

.github/workflows/build.yaml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
env:
1111
REGISTRY: ghcr.io
12+
PYTHON_VERSION: '3.10'
1213

1314
permissions:
1415
contents: read
@@ -17,10 +18,20 @@ jobs:
1718
lint:
1819
runs-on: ubuntu-latest
1920
steps:
20-
- uses: actions/checkout@v4.2.0
21-
- uses: ptxmac/yapf-action@master
21+
- uses: actions/checkout@v4
2222
with:
23-
args: --recursive --verbose
23+
fetch-depth: 0
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ env.PYTHON_VERSION }}
28+
- name: Install yapf
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install yapf
32+
- name: Run yapf
33+
run: |
34+
yapf --recursive --verbose --diff .
2435
2536
build:
2637
runs-on: ubuntu-latest
@@ -31,7 +42,7 @@ jobs:
3142
username: ${{ github.repository_owner }}
3243
password: ${{ secrets.REGISTRY_TOKEN }}
3344
steps:
34-
- uses: actions/checkout@v4.2.0
45+
- uses: actions/checkout@v4
3546
with:
3647
fetch-depth: 0
3748
set-safe-directory: true
@@ -41,7 +52,6 @@ jobs:
4152
- name: Install dependencies
4253
run: |
4354
python3 -m pip install --upgrade pip wheel setuptools setuptools-scm
44-
python3 -m pip install virtualenv
4555
python3 -m pip install build
4656
- name: Build package
4757
run: python3 -m build
@@ -65,7 +75,7 @@ jobs:
6575
username: ${{ github.repository_owner }}
6676
password: ${{ secrets.REGISTRY_TOKEN }}
6777
steps:
68-
- uses: actions/checkout@v4.2.0
78+
- uses: actions/checkout@v4
6979
with:
7080
fetch-depth: 0
7181
set-safe-directory: true
@@ -77,15 +87,14 @@ jobs:
7787
# pip3 install pytest
7888
# pip3 install pytest-cov
7989
- uses: actions/download-artifact@v4
80-
id: download
8190
with:
8291
name: snow-artifacts
8392
path: dist/
8493
- name: Install snow from artifacts
8594
run: pip3 install dist/*.tar.gz
8695
#- name: Test with pytest and pycov
87-
# run: pytest --cov=csromer --cov-report xml:coverage.xml --cov-report term-missing tests/ -W "ignore" -v
88-
#- uses: codecov/codecov-action@v2
96+
# run: pytest --cov=snow --cov-report xml:coverage.xml --cov-report term-missing tests/ -W "ignore" -v
97+
#- uses: codecov/codecov-action@v4
8998
# with:
9099
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
91100
# files: ./coverage.xml

.github/workflows/build_base_container.yaml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,42 @@ on:
66
- feature/refactoring
77
- development
88
paths:
9-
- .github/build_base_container.yaml
9+
- .github/workflows/build_base_container.yaml
1010
- Dockerfile
1111
pull_request:
1212
branches:
1313
- master
14+
paths:
15+
- .github/workflows/build_base_container.yaml
16+
- Dockerfile
1417

1518
env:
1619
REGISTRY: ghcr.io
1720

21+
permissions:
22+
contents: read
23+
packages: write
24+
1825
jobs:
1926
build:
2027
runs-on: ubuntu-latest
2128
steps:
2229
- name: Checkout Code
23-
uses: actions/checkout@v4.2.0
30+
uses: actions/checkout@v4
2431
- name: Login to GitHub Container Registry
25-
uses: docker/login-action@v1
32+
uses: docker/login-action@v3
2633
with:
2734
registry: ${{ env.REGISTRY }}
2835
username: ${{ github.repository_owner }}
2936
password: ${{ secrets.REGISTRY_TOKEN }}
3037
- name: Setup Docker Buildx
31-
uses: docker/setup-buildx-action@v2
38+
uses: docker/setup-buildx-action@v3
3239
- name: Build and Push Docker Image
33-
uses: docker/build-push-action@v2
40+
uses: docker/build-push-action@v5
3441
with:
35-
push: true # Will only build if this is not here
42+
context: .
43+
file: ./Dockerfile
44+
push: true
3645
tags: ${{ env.REGISTRY }}/${{ github.repository }}:base
46+
cache-from: type=gha
47+
cache-to: type=gha,mode=max

.github/workflows/build_latest_container.yaml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,41 @@ on:
55
branches: [master]
66
paths:
77
- '**.py'
8-
- .github/build_latest_container.yaml
8+
- .github/workflows/build_latest_container.yaml
99
- Dockerfile.prod
1010
release:
1111
types: [published]
1212

1313
env:
1414
REGISTRY: ghcr.io
15+
PYTHON_VERSION: '3.10'
16+
17+
permissions:
18+
contents: read
19+
packages: write
1520

1621
jobs:
1722
lint:
1823
runs-on: ubuntu-latest
1924
steps:
20-
- uses: actions/checkout@v4.2.0
25+
- uses: actions/checkout@v4
2126
with:
2227
fetch-depth: 0
2328
set-safe-directory: true
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: ${{ env.PYTHON_VERSION }}
2433
- name: Check git version and our path
2534
run: |
2635
git config --global --add safe.directory "$GITHUB_WORKSPACE"
27-
- uses: ptxmac/yapf-action@master
28-
with:
29-
args: --recursive --verbose
36+
- name: Install yapf
37+
run: |
38+
python -m pip install --upgrade pip
39+
pip install yapf
40+
- name: Run yapf
41+
run: |
42+
yapf --recursive --verbose --diff .
3043
build:
3144
runs-on: ubuntu-latest
3245
needs: lint
@@ -36,7 +49,7 @@ jobs:
3649
username: ${{ github.repository_owner }}
3750
password: ${{ secrets.REGISTRY_TOKEN }}
3851
steps:
39-
- uses: actions/checkout@v4.2.0
52+
- uses: actions/checkout@v4
4053
with:
4154
fetch-depth: 0
4255
set-safe-directory: true
@@ -46,15 +59,15 @@ jobs:
4659
- name: Install dependencies
4760
run: |
4861
python3 -m pip install --upgrade pip wheel setuptools setuptools-scm
49-
python3 -m pip install virtualenv
5062
python3 -m pip install build
5163
- name: Build package
5264
run: python3 -m build
5365
- name: Install snow
5466
run: pip install dist/*.tar.gz
5567
- name: Upload artifacts
56-
uses: actions/upload-artifact@v3
68+
uses: actions/upload-artifact@v4
5769
with:
70+
name: snow-artifacts
5871
path: dist/*
5972
- name: Run commands to test that everything is finished
6073
run: |
@@ -65,18 +78,21 @@ jobs:
6578
needs: build
6679
steps:
6780
- name: Checkout Code
68-
uses: actions/checkout@v1
81+
uses: actions/checkout@v4
6982
- name: Login to GitHub Container Registry
70-
uses: docker/login-action@v1
83+
uses: docker/login-action@v3
7184
with:
7285
registry: ${{ env.REGISTRY }}
7386
username: ${{ github.repository_owner }}
7487
password: ${{ secrets.REGISTRY_TOKEN }}
7588
- name: Setup Docker Buildx
76-
uses: docker/setup-buildx-action@v2
89+
uses: docker/setup-buildx-action@v3
7790
- name: Build and Push Docker Image
78-
uses: docker/build-push-action@v2
91+
uses: docker/build-push-action@v5
7992
with:
93+
context: .
8094
file: ./Dockerfile.prod
81-
push: true # Will only build if this is not here
95+
push: true
8296
tags: ${{ env.REGISTRY }}/${{ github.repository }}:latest
97+
cache-from: type=gha
98+
cache-to: type=gha,mode=max

.github/workflows/publishpypi.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
permissions:
1313
contents: read
1414

15+
env:
16+
PYTHON_VERSION: '3.10'
17+
1518
jobs:
1619
deploy:
1720
runs-on: ubuntu-latest
@@ -21,30 +24,23 @@ jobs:
2124
username: ${{ github.repository_owner }}
2225
password: ${{ secrets.REGISTRY_TOKEN }}
2326
steps:
24-
- uses: actions/checkout@v4.2.0
27+
- uses: actions/checkout@v4
2528
with:
2629
fetch-depth: 0
2730
set-safe-directory: true
2831
- name: Force directory safe
2932
run: |
3033
git config --global --add safe.directory "$GITHUB_WORKSPACE"
31-
- name: Set up Python
32-
uses: actions/setup-python@v3
33-
with:
34-
python-version: '3.8'
3534
- name: Install dependencies
3635
run: |
3736
python3 -m pip install --upgrade pip wheel setuptools setuptools-scm
38-
python3 -m pip install virtualenv
3937
python3 -m pip install build
4038
- name: Build package
4139
run: python3 -m build
42-
- name: Build bdist package
43-
run: python3 setup.py bdist_wheel
44-
- name: Publish package
45-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
46-
uses: pypa/gh-action-pypi-publish@master
40+
- name: Publish package to PyPI
41+
uses: pypa/gh-action-pypi-publish@release/v1
4742
with:
4843
user: __token__
4944
password: ${{ secrets.PYPI_API_TOKEN }}
50-
verify_metadata: false
45+
verify_metadata: true
46+
skip_existing: false

.pre-commit-config.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
repos:
22
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
3-
rev: v2.12.0
3+
rev: v2.15.0
44
hooks:
55
- id: pretty-format-yaml
66
args: [--autofix, --indent, '2']
77
- id: pretty-format-toml
88
args: [--autofix]
99

1010
- repo: https://github.com/pre-commit/pre-commit-hooks
11-
rev: v4.5.0
11+
rev: v6.0.0
1212
hooks:
1313
- id: check-yaml
1414
- id: end-of-file-fixer
@@ -19,19 +19,23 @@ repos:
1919
# hooks:
2020
# id: black
2121
- repo: https://github.com/python-jsonschema/check-jsonschema
22-
rev: 0.27.3
22+
rev: 0.36.0
2323
hooks:
2424
- id: check-github-actions
2525
- id: check-github-workflows
2626

27-
- repo: https://github.com/pre-commit/mirrors-yapf
28-
rev: v0.32.0
27+
- repo: https://github.com/google/yapf
28+
rev: v0.43.0
2929
hooks:
3030
- id: yapf
31-
additional_dependencies: [toml]
31+
name: yapf
32+
language: python
33+
entry: yapf
34+
args: [-i]
35+
types: [python]
3236

3337
- repo: https://github.com/igorshubovych/markdownlint-cli
34-
rev: v0.38.0
38+
rev: v0.47.0
3539
hooks:
3640
- id: markdownlint-fix
3741
entry: markdownlint -f '**/*.md' --disable MD013 MD036 MD046 MD033 MD041 MD040

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ objects (phase, amplitude, amplitude-phase) having the self-calibrated dataset a
1212
## Requirements
1313

1414
1. `Python == 3.8`
15-
2. Check CASA pip current version requirements [here](https://casadocs.readthedocs.io/en/stable/notebooks/introduction.html#Modular-Packages).
15+
2. Check [CASA pip package requirements](https://casadocs.readthedocs.io/en/stable/notebooks/introduction.html#Modular-Packages) for current version requirements.
1616
3. Check the `requirements.txt` file.
1717

1818
## Installation

0 commit comments

Comments
 (0)