diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..d563209 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,71 @@ +name: pypi +on: + push: + tags: + - "*" + +env: + DEFAULT_BRANCH: "main" + +jobs: + build-and-deploy: + name: Build and PyPI + runs-on: ubuntu-latest + steps: + - name: check out + uses: actions/checkout@v2 + with: + fetch-depth: 0 + lfs: true + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v2 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }} + + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --no-root + - name: Install library + run: poetry install --no-interaction + + - name: Debugging information + run: | + source .venv/bin/activate + echo "github.ref:" ${{github.ref}} + echo "github.event_name:" ${{github.event_name}} + echo "github.head_ref:" ${{github.head_ref}} + echo "github.base_ref:" ${{github.base_ref}} + set -x + git rev-parse --abbrev-ref HEAD + git branch + git branch -a + git remote -v + python -V + pip list --not-required + pip list + + - name: Build + run: poetry build + + - name: Deploy + env: + PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring + POETRY_HTTP_BASIC_PYPI_USERNAME: __token__ + POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN}} + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN}} + run: poetry publish diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..39820ce --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022, Michael Buehlmann + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..5b2752c --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,9 @@ + +include LICENSE +include README.md + +recursive-include tests * +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] + +recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif diff --git a/pyproject.toml b/pyproject.toml index 7839e7a..1e65af0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,20 @@ [tool.poetry] name = "cosmicweb-music" version = "0.1.0" -description = "" +description = "Script to download initial conditions for zoom-in cosmological simulations from the cosmICweb service." authors = ["Michael Buehlmann "] +license = "MIT" readme = "README.md" +homepage = "https://github.com/michaelbuehlmann/cosmicweb-music" +repository = "https://github.com/michaelbuehlmann/cosmicweb-music" +documentation = "https://github.com/michaelbuehlmann/cosmicweb-music" +include = ["LICENSE"] +keywords = ["scientific computing"] +classifiers = [ + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Scientific/Engineering", + "Intended Audience :: Science/Research", +] [tool.poetry.scripts] cosmicweb-music = "cosmicweb_music.cosmICweb:cli" @@ -17,3 +28,9 @@ requests = "^2.31.0" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" + +[tool.black] +line-length = 88 +target-version = ["py38"] +include = '\.pyi?$' +exclude = '\.git|\.venv|build|_build|dist'