diff --git a/.github/workflows/python-publish-test.yml b/.github/workflows/python-publish-test.yml new file mode 100644 index 00000000..7067618a --- /dev/null +++ b/.github/workflows/python-publish-test.yml @@ -0,0 +1,41 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Deploy to Test PyPI + +on: + push: + tags: + - 'v*' + +jobs: + release-test-pypi: + # Upload to Test PyPI on every pushed tag. + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + environment: + name: release-pypi + url: https://test.pypi.org/p/NREL-landbosse + permissions: + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Build package + run: | + python -m pip install --upgrade pip + pip install setuptools build wheel twine + python -m build + twine check --strict dist/* + + - name: Publish package to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: True + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 00000000..862358a4 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,39 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Deploy to PyPI + +on: + release: + types: [published] + +jobs: + release-pypi: + # Upload to PyPI on every published release + if: github.event.action == 'published' + environment: + name: release-pypi + url: https://pypi.org/p/NREL-landbosse + runs-on: ubuntu-latest + permissions: + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Build package + run: | + python -m pip install --upgrade pip + pip install setuptools build wheel twine + python -m build + twine check --strict dist/* + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: True diff --git a/README.md b/README.md index b802f824..68242cd0 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ The user guide comes in three parts: ### Software Installation +```bash +pip install NREL-landbosse +``` + There are two options depending on whether you are a developer or an end user and what operating system you are running. - **Windows end-user**: If you run the Microsoft Windows operating system and aren't setting up as a developer who is going to be modifying the core library, these instructions are for you. [Find out how to configure Windows for end users.](installation_instructions/windows_end_user.md) diff --git a/installation_instructions/macos_developer.md b/installation_instructions/macos_developer.md index e4b8d218..066aa725 100644 --- a/installation_instructions/macos_developer.md +++ b/installation_instructions/macos_developer.md @@ -95,7 +95,7 @@ pip install -e . By installing it in developer mode with `pip` you have two benefits: -1. It can be uninstalled with `pip uninstall landbosse` (you don't need to uninstall it right now) +1. It can be uninstalled with `pip uninstall NREL-landbosse` (you don't need to uninstall it right now) 1. You can update the source code with re-installing the package because `pip` uses symbolic links (aka symlinks) to reference your source code directory. ## Step 6: Copy your input data diff --git a/landbosse/__init__.py b/landbosse/__init__.py index e69de29b..5b47d4b0 100644 --- a/landbosse/__init__.py +++ b/landbosse/__init__.py @@ -0,0 +1,2 @@ + +__version__ = "2.6.1" diff --git a/pyproject.toml b/pyproject.toml index 19941c65..6cfa57ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,8 +3,8 @@ requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "landbosse" -version = "2.6.0" +name = "NREL-landbosse" +dynamic = ["version"] description = "Wind-Plant Integrated System Design & Engineering Model" readme = "README.md" requires-python = ">=3.9" @@ -36,6 +36,7 @@ classifiers = [ # Optional "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3 :: Only", "Programming Language :: C", "Programming Language :: Fortran", @@ -78,8 +79,8 @@ docs = ["sphinx", "sphinx_rtd_theme"] [tool.setuptools] include-package-data = true -#[tool.setuptools.packages] -#find = {} +[tool.setuptools.dynamic] +version = {attr = "landbosse.__version__"} [tool.setuptools.packages.find] #where = ["wisdem"]