From 81414d456da9429459c1d5d2616467e6c77423ed Mon Sep 17 00:00:00 2001 From: palewire Date: Sun, 7 Jan 2024 12:37:14 -0500 Subject: [PATCH] Updates --- .github/workflows/continuous-deployment.yml | 51 ++--- .github/workflows/docs.yml | 94 ++++++-- .github/workflows/scrape.yml | 23 +- README.md | 3 +- docs/_static/css/custom.css | 234 -------------------- docs/_templates/nav.html | 49 ---- docs/conf.py | 26 +-- docs/index.md | 6 +- docs/make.bat | 35 --- docs/requirements.txt | 2 - setup.py | 3 +- 11 files changed, 116 insertions(+), 410 deletions(-) delete mode 100644 docs/_static/css/custom.css delete mode 100644 docs/_templates/nav.html delete mode 100644 docs/make.bat delete mode 100644 docs/requirements.txt diff --git a/.github/workflows/continuous-deployment.yml b/.github/workflows/continuous-deployment.yml index fe4f274e..e6e3e48b 100644 --- a/.github/workflows/continuous-deployment.yml +++ b/.github/workflows/continuous-deployment.yml @@ -9,19 +9,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Install pipenv - run: pipx install pipenv - - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.11' cache: 'pipenv' + - name: Install pipenv + run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python + - id: pipenv-install name: Install Python dependencies - run: pipenv install --dev --python `which python` + run: pipenv sync --dev - id: run name: Run @@ -30,21 +30,21 @@ jobs: test-python: strategy: matrix: - python: ['3.8', '3.9', '3.10'] + python: ['3.9', '3.10', '3.11] name: Test runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Install pipenv - run: pipx install pipenv - - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} cache: 'pipenv' + - name: Install pipenv + run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python + - id: pipenv-install name: Install Python dependencies run: pipenv install --skip-lock --dev --python `which python` @@ -61,19 +61,19 @@ jobs: needs: [test-python] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Install pipenv - run: pipx install pipenv - - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.11' cache: 'pipenv' + - name: Install pipenv + run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python + - id: pipenv-install name: Install Python dependencies - run: pipenv install --dev --python `which python` + run: pipenv sync --dev - id: build name: Build release @@ -84,12 +84,11 @@ jobs: - id: check name: Check release - run: | - pipenv run twine check dist/* + run: pipenv run twine check dist/* - id: save name: Save artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test-release-${{ github.run_number }} path: ./dist @@ -101,13 +100,9 @@ jobs: needs: [test-build] if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') steps: - - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - id: fetch name: Fetch artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: test-release-${{ github.run_number }} path: ./dist diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3c13229b..cb1ae1f1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,29 +1,79 @@ -name: "Build documentation" +name: Documentation + on: push: - pull_request: workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: - docs: - name: "Build and deploy" + build: + name: Build + runs-on: ubuntu-latest + steps: + - id: checkout + name: Checkout + uses: actions/checkout@v4 + + - id: setup-python + name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'pipenv' + + - id: install-pipenv + name: Install pipenv + run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python + shell: bash + + - id: install-python-dependencies + name: Install Python dependencies + run: pipenv sync --dev + shell: bash + + - id: build-sphinx-documentation + name: Build Sphinx documentation + run: pipenv run make html + shell: bash + working-directory: docs + + - id: upload-release-candidate + name: Upload release candidate + uses: actions/upload-artifact@v4 + with: + name: release-candidate + path: ./docs/_build/html/ + + deploy: + name: Deploy runs-on: ubuntu-latest + needs: build + if: ${{ github.ref_name == 'main' }} steps: - - uses: actions/checkout@v3 - - - uses: ammaraskar/sphinx-action@master - with: - docs-folder: "docs/" - - - uses: actions/upload-artifact@v3 - with: - name: documentation-html - path: docs/_build/html/ - - - uses: shallwefootball/s3-upload-action@master - with: - aws_key_id: ${{ secrets.PALEWIRE_DOCS_AWS_ACCESS_KEY_ID }} - aws_secret_access_key: ${{ secrets.PALEWIRE_DOCS_AWS_SECRET_ACCESS_KEY }} - aws_bucket: ${{ secrets.PALEWIRE_DOCS_AWS_BUCKET }} - source_dir: docs/_build/html/ - destination_dir: nws-wwa + - name: Download release candidate + uses: actions/download-artifact@v4 + with: + name: release-candidate + path: ./docs/ + + - id: configure-aws + name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.PALEWIRE_DOCS_AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.PALEWIRE_DOCS_AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + + - id: upload-to-s3 + name: Upload documentation to Amazon S3 + uses: datadesk/delivery-deploy-action@v1 + with: + bucket: ${{ secrets.PALEWIRE_DOCS_AWS_BUCKET }} + base-path: nws-wwa/ + dir: ./docs/ + should-cache: false + use-accelerate-endpoint: false + public: true diff --git a/.github/workflows/scrape.yml b/.github/workflows/scrape.yml index 5f4230ff..13b0c351 100644 --- a/.github/workflows/scrape.yml +++ b/.github/workflows/scrape.yml @@ -9,21 +9,20 @@ jobs: name: Scrape runs-on: ubuntu-latest steps: - - id: checkout - name: Checkout - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 - - name: Install pipenv - run: pipx install pipenv - - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.11' cache: 'pipenv' + - name: Install pipenv + run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python + - id: pipenv-install name: Install Python dependencies - run: pipenv install --dev --python `which python` + run: pipenv sync --dev - id: package-install name: Install package @@ -45,12 +44,16 @@ jobs: run: pipenv run nwswwa warnings > data/warnings.json shell: bash + - name: Datestamp + run: date > data/timestamp.txt + shell: bash + - id: commit name: Commit results run: | git config --global user.name "github-actions[bot]" git config --global user.email "actions@github.com" git config pull.rebase false - git add ./ + git add ./data git commit -m "Scrape" && git push || true shell: bash diff --git a/README.md b/README.md index 3a5f36c2..f6c7066b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ -### Links +### Other resources -* Docs: [palewi.re/docs/nws-wwa/](https://palewi.re/docs/nws-wwa/) * Source: [www.spc.noaa.gov/products/wwa/](https://www.spc.noaa.gov/products/wwa/) * Issues: [github.com/datadesk/nws-wwa/issues](https://github.com/datadesk/nws-wwa/issues) * Packaging: [pypi.python.org/pypi/nws-wwa](https://pypi.python.org/pypi/nws-wwa) diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css deleted file mode 100644 index b6b8bd06..00000000 --- a/docs/_static/css/custom.css +++ /dev/null @@ -1,234 +0,0 @@ -@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:ital,wght@0,400;0,700;0,800;1,400;1,800&display=swap'); - -div.document { - margin-top: 0; -} - -div.body { - min-width: 0 !important; -} - -div.body p, div.body li { - line-height: 1.45; -} - -div.body li { - margin-bottom: 4px; -} - -div.topic { - margin: 0; - padding: 8px 12px; -} - -p.topic-title { - margin: 0; -} - -div.topic ul { - margin-top: 6px; -} -@media screen and (max-width: 870px) { - ul { - margin: 10px 0 10px 20px; - } -} - -div.sphinxsidebar h1.logo, -div.sphinxsidebar h3 { - font-family: 'Libre Franklin', "Helvetica", "Liberation Sans", Arial, sans-serif; -} - -div.sphinxsidebarwrapper h1.logo { - font-size: 1.85em; - font-weight: 800; -} - -@media (min-width: 875px) { - div.sphinxsidebar { - margin-top: 85px; - } -} - -@media screen and (max-width: 875px) { - div.sphinxsidebar { - width: auto; - padding: 10px 20px; - margin: 50px 0 0 0; - } -} - -div.admonition { - padding: 15px; -} - -div.warning { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.admonition p.admonition-title { - font-family: 'Libre Franklin', "Helvetica", "Liberation Sans", Arial, sans-serif; - margin: 0; -} - -div.related nav { - padding-right: 10px; -} - -body { - font-family: 'Libre Franklin', "Helvetica", "Liberation Sans", Arial, sans-serif; - font-size: 20px; - line-height: 1.45; - text-align: left; -} -@media screen and (max-width: 875px) { - body { - margin: 0; - padding: 0; - } - div.body > .section, - div.body > section { - padding: 0 20px; - } -} - -@media (max-width: 550px) { - body { - font-size: 0.85em; - } -} - -div.body h1, div.body h2, div.body h3, div.body h4, div.body h5, div.body h6 { - font-family: 'Libre Franklin', "Helvetica", "Liberation Sans", Arial, sans-serif; - font-weight: 700; -} - -div.body h1 { - font-weight: 800; - font-size: 220%; -} - -pre { - padding: 7px; -} - -.cell_output { - overflow: auto; -} - -.toctree-wrapper p.caption { - font-weight: 700; -} - -.toggle-details { - display: none; -} - -.row { - width: 100%; - max-width: 660px; - margin: 0 auto; - overflow: hidden; -} -.row .fivecol { - width: 43%; - float: right; - min-height: 1px; -} -.row .sevencol { - width: 37%; - float: left; - min-height: 1px; -} -@media (max-width: 550px) { - .row .fivecol, .row .sevencol { - padding: 0 20px; - } -} - -/* The header */ -nav { - display: block; - margin-top: 0.75em; - margin-bottom: 0.5em; - font-size: 1em; - line-height: 1.7em; -} -nav .shingle { - font-size: 1.7em; - font-weight: bold; - text-align: left; - padding-left: 0.15em; -} -nav .shingle a { - text-decoration: none; - font-weight: bold; - color: #000; -} -nav .shingle a:hover { - color: #686868; -} -@media (max-width: 550px) { - nav .shingle { - float: left; - margin-bottom: 5px; - padding-left: 0; - } -} -nav .links { - text-align: right; -} -nav .links ul { - float: right; - list-style-type: none; - margin: 4px 0 0 0; -} -nav .links li { - float: left; - list-style-position: inside; - margin-left: 0.5em; - font-size: 0.9em; - font-weight: 300; - margin-bottom: 0; -} -@media (max-width: 550px) { - nav .links li { - font-size: .825em; - } -} -nav .links li a { - text-decoration: none; -} -nav .links li a:hover { - text-decoration: underline; -} -.last { - margin-right: 0; -} - -.topbar { - border-bottom: solid 10px #e5e5e5; - margin-bottom: 20px; - width: 100%; -} - -a:link { - text-decoration: none; - color: #686868; -} -a:visited { - text-decoration: none; - color: #686868; -} -a:hover { - text-decoration: underline; -} -a:active { - text-decoration: underline; - color: #000; -} - -.contents ul p { - margin-bottom: 0; -} diff --git a/docs/_templates/nav.html b/docs/_templates/nav.html deleted file mode 100644 index cd40a0ec..00000000 --- a/docs/_templates/nav.html +++ /dev/null @@ -1,49 +0,0 @@ - - - -
-
-
diff --git a/docs/conf.py b/docs/conf.py index 9d6e7d5b..61033c55 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,35 +9,19 @@ extensions = [ "myst_parser", ] -templates_path = ["_templates"] -source_suffix = ".rst" +source_suffix = ".md" master_doc = "index" project = "nws-wwa" year = datetime.now().year -copyright = f"{year} Ben Welsh" +copyright = f"{year} palewire" exclude_patterns = ["_build"] -html_theme = "alabaster" -html_sidebars = { - "**": [ - # "about.html", - # "navigation.html", - "relations.html", - "searchbox.html", - "donate.html", - ] -} +html_theme = "palewire" +html_sidebars = {} html_theme_options = { "canonical_url": f"https://palewi.re/docs/{project}/", - "show_powered_by": False, - "show_relbar_bottom": True, + "nosidebar": True, } - -html_static_path = ["_static"] -html_css_files = [ - "css/custom.css", -] - pygments_style = "sphinx" diff --git a/docs/index.md b/docs/index.md index 4779d245..da63aabc 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,3 @@ -```{include} _templates/nav.html -``` - # nws-wwa Download watch, warning and advisory data from the [National Weather Service](https://www.spc.noaa.gov/products/wwa/) @@ -75,9 +72,8 @@ The command-line interface is implemented using Click and setuptools. To install pipenv run pip install --editable . ``` -## Links +## Other resources -* Docs: [palewi.re/docs/nws-wwa/](https://palewi.re/docs/nws-wwa/) * Source: [www.spc.noaa.gov/products/wwa/](https://www.spc.noaa.gov/products/wwa/) * Issues: [github.com/datadesk/nws-wwa/issues](https://github.com/datadesk/nws-wwa/issues) * Packaging: [pypi.python.org/pypi/nws-wwa](https://pypi.python.org/pypi/nws-wwa) diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 32bb2452..00000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 98a3c62a..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -sphinx -myst-parser diff --git a/setup.py b/setup.py index a3738a49..a16c1e8f 100644 --- a/setup.py +++ b/setup.py @@ -54,10 +54,9 @@ def local_version(version): classifiers=[ "Development Status :: 5 - Production/Stable", "Programming Language :: Python", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "License :: OSI Approved :: MIT License", ], project_urls={