diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5a2c47c4..b65adfa0 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -2,10 +2,10 @@ name: "CodeQL" on: push: - branches: [master, pre-release, develop] + branches: [ main, pre-release, develop ] pull_request: # The branches below must be a subset of the branches above - branches: [master] + branches: [ main ] schedule: - cron: '0 16 * * 5' diff --git a/.github/workflows/documentation_build.yml b/.github/workflows/documentation-deploy.yml similarity index 80% rename from .github/workflows/documentation_build.yml rename to .github/workflows/documentation-deploy.yml index dc8d64c6..d22e7651 100644 --- a/.github/workflows/documentation_build.yml +++ b/.github/workflows/documentation-deploy.yml @@ -1,10 +1,12 @@ -# This is a basic workflow to help you get started with Actions +# This pipeline +# - build html documentation +# - deploy html documentation to gh-pages branch of the same repository -name: Build Documentation +name: Build and Deploy Documentation # Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the master branch + # Triggers the workflow on push or pull request events but only for the main branch push: branches: [ main ] @@ -24,11 +26,11 @@ jobs: - name: Upgrade pip run: | python -m pip install --upgrade pip - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v2 with: python-version: 3.9 - - name: Install EasyReflectometry and dependencies + - name: Install Pandoc, EasyReflectometry and dependencies run: | sudo apt install pandoc pip install . '.[dev]' diff --git a/.github/workflows/ci_pip.yml b/.github/workflows/python-ci.yml similarity index 72% rename from .github/workflows/ci_pip.yml rename to .github/workflows/python-ci.yml index 7996d399..0c8ab650 100644 --- a/.github/workflows/ci_pip.yml +++ b/.github/workflows/python-ci.yml @@ -1,3 +1,15 @@ +# This workflow will for a variety of Python versions +# - install the code base +# - lint the code base +# - test the code base +# - upload the test coverage to codecov +# +# It will also +# - build the package +# - check the package +# +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + name: CI using pip on: [push, pull_request] @@ -37,7 +49,7 @@ jobs: tox - name: Upload coverage - uses: codecov/codecov-action@v1.0.7 + uses: codecov/codecov-action@v3 with: name: Pytest coverage env_vars: OS,PYTHON,GITHUB_ACTIONS,GITHUB_ACTION,GITHUB_REF,GITHUB_REPOSITORY,GITHUB_HEAD_REF,GITHUB_RUN_ID,GITHUB_SHA,COVERAGE_FILE @@ -45,7 +57,7 @@ jobs: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} - test_Packaging: + Package_Testing: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" @@ -57,13 +69,12 @@ jobs: with: python-version: 3.9 - - name: install pypa/build - run: python -m pip install build --user - - - name: build a binary wheel and source tarball - run: python -m build --sdist --wheel --outdir dist/ . + - name: Install dependencies and build + run: | + pip install -e '.[dev]' + python -m build - name: Check Build run: | - pip install twine - python -m twine check dist/* \ No newline at end of file + cd ./dist + pytest ../ diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4fafd5ce..6c12726b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -1,13 +1,17 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# This workflow will for a variety of Python versions +# - build a python package +# - run tests on the produced package +# - upload the package as an artifact +# # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Python package testing +name: Create Python Package on: push: - branches: [master, pre-release] + branches: [ main, pre-release ] pull_request: - branches: [master, pre-release] + branches: [ main, pre-release ] jobs: build: @@ -23,10 +27,10 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install dependencies and build run: | pip install -e '.[dev]' - pip install build --sdist --wheel --outdir dist/ . + python -m build - name: Test with pytest run: | cd ./dist diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 9d87d1e6..0389c13d 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,12 +1,15 @@ -# This workflows will upload a Python Package using Twine when a release is created +# This workflow will +# - build distribution package, pure python wheel +# - deploy produced distribution package to PyIP +# # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries -name: Upload Python Package +name: Deploy Python Package on: workflow_dispatch: push: - branches: [ master ] + branches: [main] tags: - 'v*' @@ -16,20 +19,18 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 with: - python-version: '3.9' - - uses: Gr1N/setup-poetry@v7 - - name: Install dependencies + python-version: 3.9 + + - name: Install dependencies and build run: | - python -m pip install --upgrade pip pip install -e '.[dev]' - - name: Build - run: | - pip install build + python -m build + - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_PASSWORD }} diff --git a/EasyReflectometry/__init__.py b/EasyReflectometry/__init__.py index c6ababda..2c368383 100644 --- a/EasyReflectometry/__init__.py +++ b/EasyReflectometry/__init__.py @@ -1,4 +1,4 @@ MAJOR = 0 MINOR = 0 -MICRO = 2 +MICRO = 3 __version__ = f'{MAJOR:d}.{MINOR:d}.{MICRO:d}' diff --git a/README.rst b/README.rst index 1d21180a..92cd8e18 100644 --- a/README.rst +++ b/README.rst @@ -3,8 +3,8 @@ | -.. image:: https://github.com/easyScience/EasyReflectometryLib/actions/workflows/ci_pip.yml/badge.svg - :target: https://github.com/easyScience/easyReflectometryLib/actions/workflows/ci_pip.yml +.. image:: https://github.com/easyScience/EasyReflectometryLib/actions/workflows/python-ci.yml/badge.svg + :target: https://github.com/easyScience/easyReflectometryLib/actions/workflows/python-ci.yml .. image:: https://codecov.io/gh/easyScience/EasyReflectometryLib/branch/main/graph/badge.svg?token=LcnB8AMGkw :target: https://codecov.io/gh/easyScience/EasyReflectometryLib .. image:: https://www.codefactor.io/repository/github/easyscience/easyreflectometrylib/badge @@ -21,5 +21,9 @@ What is EasyReflectometry? EasyReflectometry is a reflectometry analysis package built on the `easyScience framework`_. +This is the documentation for the EasyReflectometry Python library, but a graphical user application is also available. +Find out about that at `easyreflectometry.org`_. + .. _`easyScience framework`: https://easyscience.software +.. _`easyreflectometry.org`: https://easyreflectometry.org diff --git a/pyproject.toml b/pyproject.toml index 27fa016c..0aa41e09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "EasyReflectometryLib" -version = "0.0.2" +version = "0.0.3" description = "A reflectometry python package built on the EasyScience framework." readme = "README.rst" authors = [ @@ -25,7 +25,7 @@ classifiers = [ ] requires-python = ">=3.9,<3.12" dependencies = [ - "easyScienceCore @ git+https://github.com/easyscience/easycore.git@failed_unit_check", + "easyScienceCore>=0.3.1", "refnx>=0.1.15", "refl1d>=0.8.14", "scipp>=23.12.0", @@ -34,6 +34,7 @@ dependencies = [ [project.optional-dependencies] dev = [ + "build", "codecov>=2.1.11", "coverage", "coveralls", @@ -72,7 +73,7 @@ packages = ["EasyReflectometry"] legacy_tox_ini = """ [tox] isolated_build = True -envlist = py{38,39,310,311} +envlist = py{39,310,311} [gh-actions] python = 3.9: py39