diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3f426e2d4..87240dbce 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,9 +13,9 @@ on: jobs: - publish-to-test-pypi: + publish-to-pypi-test: runs-on: ubuntu-latest - + if: github.event_name == 'workflow_dispatch' steps: - uses: actions/checkout@v3 @@ -42,16 +42,39 @@ jobs: run: hatch publish -r test working-directory: openfast_io - # - name: Publish to PyPI - # env: - # HATCH_INDEX_USER: __token__ - # HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }} - # run: hatch publish - # working-directory: openfast_io + publish-to-pypi: + runs-on: ubuntu-latest + if: github.event_name == 'release' + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + cache: 'pip' + + - name: Install Hatch + uses: pypa/hatch@install + + - name: Install dependencies + run: pip install keyring[file] + + - name: Build package + run: hatch build + working-directory: openfast_io + + - name: Publish to PyPI + env: + HATCH_INDEX_USER: __token__ + HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }} + run: hatch publish + working-directory: openfast_io docker-build-and-push: runs-on: ubuntu-latest - timeout-minutes: 300 + if: github.event_name == 'release' + timeout-minutes: 500 env: DOCKERFILE_PATH: share/docker/Dockerfile DOCKERHUB_REPOSITORY: nrel/openfast diff --git a/docs/source/install/index.rst b/docs/source/install/index.rst index b394ed808..6bd5b81ab 100644 --- a/docs/source/install/index.rst +++ b/docs/source/install/index.rst @@ -217,17 +217,29 @@ You can also build your own custom images using our `Dockerfile` or base your im Install the ``openfast_io`` python wrapper ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ``openfast_io`` python package is a wrapper comprising readers and writers for converting OpenFAST files to/from -python objects. You can install it with: +python objects. -.. code-block:: +To use `openfast_io` as a library for incorporation into other scripts or tools, it is available via (assuming that you have already setup your python environment): + +.. code-block:: bash pip install openfast_io -or +These instructions are for interaction directly with the `openfast_io` source code. + +1. Follow this step only if you have not cloned the OpenFAST repo: + +.. code-block:: bash + + git clone https://github.com/OpenFAST/OpenFAST.git + cd OpenFAST -.. code-block:: +2. Assuming you are within the OpenFAST directory: + +.. code-block:: bash - poetry add openfast_io + cd openfast_io + pip install -e . For more information and installation options, see the `OpenFAST Python readme `_. diff --git a/openfast_io/README.md b/openfast_io/README.md index 796c7a563..4d1d77dfd 100644 --- a/openfast_io/README.md +++ b/openfast_io/README.md @@ -4,21 +4,48 @@ This package is a python wrapper comprising readers and writers for converting O was originally written for [WEIS](https://github.com/WISDEM/WEIS/tree/77a878d7989b8c1d07d2244135ccd308a193a924/weis/aeroelasticse) and has been ported over to OpenFAST to make it more widely accessible. ## Installation -Run either +Installation with [Anaconda](https://www.anaconda.com) is the recommended approach because of the ability to create self-contained environments suitable for testing and analysis. + +### Installation as a "library" + +To use `openfast_io` as a library for incorporation into other scripts or tools, it is available via (assuming that you have already setup your python environment): + ```shell pip install openfast_io ``` -or -```shell -poetry add openfast_io -``` + +### Installation as an editable library + +These instructions are for interaction directly with the `openfast_io` source code. + +0. Follow this step only if you have not cloned the OpenFAST repo. + ```shell + git clone https://github.com/OpenFAST/OpenFAST.git + cd OpenFAST + ``` + +1. Assuming you are within the OpenFAST directory. + ```shell + cd openfast_io + pip install -e . + ``` + +2. To test `openfast_io`, OpenFAST must be compiled within the build folder, then run: + + ```shell + cd tests + pytest test_of_io_pytest.py + ``` ### Extra options [ROSCO](https://github.com/NREL/ROSCO) can be installed as an optional dependency. Run either ```shell pip install openfast_io[rosco] ``` -or + +## Development and testing +To contribute to the development of `openfast_io`, install additioal depemndancies using: + ```shell -poetry add -E rosco openfast_io +pip install -e ".[all]" ``` diff --git a/openfast_io/pyproject.toml b/openfast_io/pyproject.toml index 9261c67ed..0ceb04bbb 100644 --- a/openfast_io/pyproject.toml +++ b/openfast_io/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] name = "openfast_io" # dynamic = ["version"] -version = "4.0.0.b1" +version = "4.0.0" description = "Readers and writers for OpenFAST files." license = {file = "../LICENSE"} authors = [