diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..12215c1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,15 @@ +name: build + +on: + release: + types: [ released ] + pull_request: + workflow_dispatch: + +jobs: + build: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1 + with: + upload_to_pypi: ${{ (github.event_name == 'release') && (github.event.action == 'released') }} + secrets: + pypi_token: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..81e5ba3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +name: test + +on: + workflow_dispatch: + push: + branches: + - master + - main + pull_request: + branches: + - master + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + - run: pip install ruff + - run: ruff check . + test: + name: test (Python ${{ matrix.python-version }}, ${{ matrix.runs-on }}) + runs-on: ${{ matrix.runs-on }} + strategy: + matrix: + runs-on: [ "ubuntu-latest", "macos-latest" ] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ] + fail-fast: false + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + - run: pip install -e .[test] pytest-xdist + - run: pip list + - run: pytest -n auto . diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 0c1b964..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,60 +0,0 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -trigger: -- master - -variables: - PYTHONUNBUFFERED: '1' - -jobs: -- template: azure-templates.yml - parameters: - name: Linux - os: linux - -- template: azure-templates.yml - parameters: - name: MacOS - os: macos - -- template: azure-templates.yml - parameters: - name: Windows - os: windows - -- job: 'PEP8' - pool: - vmImage: 'ubuntu-latest' - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.x' - architecture: 'x64' - - - script: | - python -m pip install --upgrade flake8 - flake8 - displayName: 'Run check' - - -- job: 'Publish' - dependsOn: 'Linux' - pool: - vmImage: 'ubuntu-latest' - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.x' - architecture: 'x64' - - - script: | - python -m pip install setuptools - python -m pip install setuptools_scm - python -m pip install astropy - python setup.py sdist - displayName: 'Build sdist' diff --git a/azure-templates.yml b/azure-templates.yml deleted file mode 100644 index 96a71b5..0000000 --- a/azure-templates.yml +++ /dev/null @@ -1,73 +0,0 @@ -jobs: -- job: ${{ format(parameters.name) }} - pool: - ${{ if eq(parameters.os, 'windows') }}: - vmImage: windows-latest - ${{ if eq(parameters.os, 'macos') }}: - vmImage: macOS-latest - ${{ if eq(parameters.os, 'linux') }}: - vmImage: ubuntu-latest - - strategy: - matrix: - Python39: - python.version: '3.9' - Python310: - python.version: '3.10' - Python311: - python.version: '3.11' - Python312: - python.version: '3.12' - maxParallel: 4 - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - architecture: 'x64' - - - bash: | - export PIP_INSTALL='pip install --upgrade' - echo "##vso[task.setvariable variable=PIP_INSTALL]$PIP_INSTALL" - condition: ne( variables['Agent.OS'], 'Windows_NT' ) - displayName: Pip on Linux/Darwin - - - powershell: | - Set-Variable -Name PIP_INSTALL -Value 'python -m pip install --upgrade' - Write-Host "##vso[task.setvariable variable=PIP_INSTALL]$PIP_INSTALL" - condition: eq( variables['Agent.OS'], 'Windows_NT' ) - displayName: Pip on Windows - - - script: | - $(PIP_INSTALL) -e .[test] - displayName: build package - - - script: | - python -m pip freeze - displayName: freeze output - - - script: | - pytest --cov=./ -v --junitxml=junit/test-results.xml - displayName: run test - - - bash: | - curl -Os https://uploader.codecov.io/latest/${{parameters.os}}/codecov - chmod +x codecov - ./codecov -t $codecov_token - env: - codecov_token: $(CODECOV_TOKEN) - condition: ne( variables['Agent.OS'], 'Windows_NT' ) - displayName: codecov upload on Linux/Darwin - - - powershell: | - $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe - .\codecov.exe -t ${CODECOV_TOKEN} - condition: eq( variables['Agent.OS'], 'Windows_NT' ) - displayName: codecov upload on Windows - - - task: PublishTestResults@2 - condition: succeededOrFailed() - inputs: - testResultsFiles: '**/test-*.xml' - testRunTitle: 'Python $(python.version)-${{ format(parameters.name) }}' diff --git a/docs/conf.py b/docs/conf.py index 6c38542..687efb6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,6 +6,7 @@ import sphinx import stsci_rtd_theme from packaging.version import Version +import wiimatch try: from ConfigParser import ConfigParser except ImportError: @@ -113,7 +114,6 @@ def check_sphinx_version(expected_version): # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # build documents. -import wiimatch release = f"{wiimatch.__version__:s}" version = release