diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml new file mode 100644 index 00000000..268062d6 --- /dev/null +++ b/.github/workflows/bump.yml @@ -0,0 +1,94 @@ +name: Bump package version +on: + workflow_dispatch: + inputs: + dry-run: + type: boolean + description: Only output new version number, no actual change. + required: false + rule: + type: choice + description: Version bump level + required: true + options: + - major + - minor + - patch + - premajor + - preminor + - prepatch + - prerelease + - "prerelease --next-phase" + + workflow_call: + inputs: + dry-run: + type: boolean + description: Only output new version number, no actual change. + required: false + rule: + type: string + description: Version bump level + required: true + branch: + type: string + description: Branch (ref) to checkout and push changes to + required: false + default: ${{ github.ref_name }} + outputs: + bumpmsg: + description: Message created by the version bump. + value: ${{ jobs.bump.outputs.bumpmsg }} + +jobs: + bump: + name: Bump version number + runs-on: ubuntu-latest + permissions: + contents: write + outputs: + bumpmsg: ${{ steps.bumping.outputs.BUMP_MSG }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Set up Poetry + uses: abatilo/actions-poetry@v2 + with: + poetry-version: "1.8.3" + + - name: Bump package Version using Poetry + id: bumping + env: + RULE: ${{ inputs.rule }} + DRY: ${{ inputs.dry-run && '--dry-run' || '' }} + run: echo "BUMP_MSG=$(poetry version $DRY $RULE)" >> $GITHUB_OUTPUT + + - name: Output debug msg + if: inputs.dry-run + env: + BUMP_MSG: ${{ steps.bumping.outputs.BUMP_MSG }} + run: | + echo "## $BUMP_MSG" >> $GITHUB_STEP_SUMMARY + echo "Dry run only, no actual modification made." >> $GITHUB_STEP_SUMMARY + + - name: Commit changes + # could also use https://github.com/stefanzweifel/git-auto-commit-action instead + if: ${{ ! inputs.dry-run }} + env: + BUMP_MSG: ${{ steps.bumping.outputs.BUMP_MSG }} + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git commit -am "$BUMP_MSG" + git push + echo "## $BUMP_MSG" >> $GITHUB_STEP_SUMMARY + echo "Successfully committed and pushed version bump." >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml new file mode 100644 index 00000000..ec8179d8 --- /dev/null +++ b/.github/workflows/publish_pypi.yml @@ -0,0 +1,88 @@ +name: Release on PyPI +on: + release: + types: + - published + +jobs: + build: + name: Build package using Poetry + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Set up Poetry + uses: abatilo/actions-poetry@v2 + with: + poetry-version: "1.8.3" + + - name: Create step summary + run: echo "## Building $(poetry version)" >> $GITHUB_STEP_SUMMARY + + - name: Build package + run: poetry build >> $GITHUB_STEP_SUMMARY + + - name: Store distribution files + uses: actions/upload-artifact@v3 + with: + name: distribution + path: dist/ + + - name: Upload release attachment + uses: shogo82148/actions-upload-release-asset@v1 + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: dist/* + + - name: Add to step summary + if: ${{ success() }} + run: echo "### Successfully built package" >> $GITHUB_STEP_SUMMARY + + publish: + name: Publish package to PyPI + runs-on: ubuntu-latest + needs: build + if: needs.build.result == 'success' + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Set up Poetry + uses: abatilo/actions-poetry@v2 + with: + poetry-version: "1.8.3" + + - name: Create step summary + run: echo "## Publishing $(poetry version) to PyPI" >> $GITHUB_STEP_SUMMARY + + - name: Retrieve distribution files + uses: actions/download-artifact@v3 + with: + name: distribution + path: dist/ + + - name: Publish to PyPI + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} + run: poetry publish >> $GITHUB_STEP_SUMMARY + + bump: + name: Bump to (next) dev version + needs: publish + if: ${{ needs.publish.result == 'success' }} + uses: ./.github/workflows/bump.yml + secrets: inherit + with: + rule: prerelease + branch: main diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a5e3d3a..2e5261f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,42 @@ +# Version 0.8.4 +**2024-08-29** + +*Last version to support Python 3.9* + +This includes many small and not-so-small fixes and improvements, which are made available here to Python 3.9, while a few more major changes will be released soon as Version 0.9.0, but without support for Python 3.9. + +## What's Changed +### Changes to or addition of Effects +* Test all cases of DIT & NDIT vs. exptime and AutoExposure by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/428 +* Avoid in-place operations because of dtype conflicts by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/432 +* Split PSF and Electronic effects into subpackages by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/434 +* Improve SVO filter handling by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/454 +* Added function to round the edges of square PSF kernels by @astronomyk in https://github.com/AstarVienna/ScopeSim/pull/459 +### Dependency Changes +* Bump tornado from 6.4 to 6.4.1 by @dependabot in https://github.com/AstarVienna/ScopeSim/pull/427 +* Bump urllib3 from 1.26.18 to 1.26.19 by @dependabot in https://github.com/AstarVienna/ScopeSim/pull/429 +* Bump certifi from 2023.11.17 to 2024.7.4 by @dependabot in https://github.com/AstarVienna/ScopeSim/pull/435 +* Bump zipp from 3.17.0 to 3.19.1 by @dependabot in https://github.com/AstarVienna/ScopeSim/pull/436 +* Bump setuptools from 69.0.2 to 70.0.0 by @dependabot in https://github.com/AstarVienna/ScopeSim/pull/437 +* Bump some dependencies to get rid of some indirect ones by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/445 +* Use `pooch` for `download_example_data` by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/446 +* Bump matplotlib, synphot, pyerfa by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/450 +### Other Changes +* Formatting and Refactoring of `nghxrg.py` by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/431 +* Rename `DetectorArray` ➡️ `DetectorManager` plus Docstrings and Refactoring by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/423 +* Enlarge initial Field of View to suppord wide-field imagers by @hugobuddel in https://github.com/AstarVienna/ScopeSim/pull/433 +* Fix some exposure things by @hugobuddel in https://github.com/AstarVienna/ScopeSim/pull/440 +* Deepcopy readout, to prevent it being overwritten. Closes #439 by @hugobuddel in https://github.com/AstarVienna/ScopeSim/pull/441 +* Allow star to be shifted by @hugobuddel in https://github.com/AstarVienna/ScopeSim/pull/443 +* Attempt to catch crypto warning by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/444 +* Use new main branch for DevOps workflows by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/448 +* Refactor `example_data_utils` by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/447 +* Remove unused function `return_latest_github_actions_jobs_status()` by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/449 +* Remove remaining master references by @teutoburg in https://github.com/AstarVienna/ScopeSim/pull/460 +* Add units to DataContainer table directly. by @hugobuddel in https://github.com/AstarVienna/ScopeSim/pull/461 + +**Full Changelog**: https://github.com/AstarVienna/ScopeSim/compare/v0.8.3...v0.8.4 + # Version 0.8.3 **2024-06-02** diff --git a/pyproject.toml b/pyproject.toml index 550a1e0b..e7641b3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ScopeSim" -version = "0.8.4a0" +version = "0.8.4rc0" description = "Generalised telescope observation simulator" license = "GPL-3.0-or-later" authors = ["Kieran Leschinski "]