diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..b4b3fa44f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: + # - package-ecosystem: pip + # directory: "/" + # schedule: + # interval: daily + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + # Check for updates once a week + interval: 'weekly' diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 353e0b861..d546d216f 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -4,7 +4,7 @@ name: deploy-book on: push: branches: - - main + - main # If your git repository has the Jupyter Book within some-subfolder next to # unrelated files, you can make this run only if a file within that specific # folder has been modified. @@ -17,26 +17,26 @@ jobs: deploy-book: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - # Install dependencies - - name: Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 + # Install dependencies + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 - - name: Install dependencies - run: | - pip install -r requirements.txt + - name: Install dependencies + run: | + pip install -r requirements.txt - # Build the book - - name: Build the book - run: | - jupyter-book build . + # Build the book + - name: Build the book + run: | + jupyter-book build . - # Push the book's HTML to github-pages - - name: GitHub Pages action - uses: peaceiris/actions-gh-pages@v3.6.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./_build/html + # Push the book's HTML to github-pages + - name: GitHub Pages action + uses: peaceiris/actions-gh-pages@v3.6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_build/html diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml new file mode 100644 index 000000000..497ec5991 --- /dev/null +++ b/.github/workflows/linting.yaml @@ -0,0 +1,15 @@ +name: linting + +on: + push: + branches: '*' + pull_request: + branches: '*' + +jobs: + linting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: pre-commit/action@v2.0.0 diff --git a/.github/workflows/preview-book.yaml b/.github/workflows/preview-book.yaml index 486c27288..901d651b5 100644 --- a/.github/workflows/preview-book.yaml +++ b/.github/workflows/preview-book.yaml @@ -3,7 +3,7 @@ on: workflow_run: workflows: - deploy-book - types: + types: - completed jobs: deploy: @@ -28,7 +28,7 @@ jobs: rm -f book.zip - name: Deploy to Netlify id: netlify - uses: nwtgck/actions-netlify@v1.1.5 + uses: nwtgck/actions-netlify@v1.1.13 with: publish-dir: ./_build/html production-deploy: false @@ -37,10 +37,9 @@ jobs: env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + timeout-minutes: 5 - name: Jupyter Book Preview uses: ProjectPythia/actions/comment-netlify-preview-in-pr@main with: github-token: ${{ secrets.GITHUB_TOKEN }} - deploy_url: "${{ steps.netlify.outputs.deploy-url }}" - - \ No newline at end of file + deploy_url: '${{ steps.netlify.outputs.deploy-url }}' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..2551bd99c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,49 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-docstring-first + - id: check-json + - id: check-yaml + - id: double-quote-string-fixer + + - repo: https://github.com/ambv/black + rev: 20.8b1 + hooks: + - id: black + + - repo: https://github.com/keewis/blackdoc + rev: v0.3.3 + hooks: + - id: blackdoc + + - repo: https://gitlab.com/pycqa/flake8 + rev: 3.8.4 + hooks: + - id: flake8 + + - repo: https://github.com/asottile/seed-isort-config + rev: v2.2.0 + hooks: + - id: seed-isort-config + - repo: https://github.com/pre-commit/mirrors-isort + rev: v5.7.0 + hooks: + - id: isort + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.2.1 + hooks: + - id: prettier + + - repo: https://github.com/nbQA-dev/nbQA + rev: 0.5.7 + hooks: + - id: nbqa-black + additional_dependencies: [black==20.8b1] + - id: nbqa-pyupgrade + additional_dependencies: [pyupgrade==2.7.3] + - id: nbqa-isort + additional_dependencies: [isort==5.6.4] diff --git a/.prettierrc.toml b/.prettierrc.toml new file mode 100644 index 000000000..addd6d363 --- /dev/null +++ b/.prettierrc.toml @@ -0,0 +1,3 @@ +tabWidth = 2 +semi = false +singleQuote = true diff --git a/_config.yml b/_config.yml index d10c03d68..ba9ce0d64 100644 --- a/_config.yml +++ b/_config.yml @@ -21,12 +21,12 @@ bibtex_bibfiles: # Information about where the book exists on the web repository: - url: https://github.com/ProjectPythia/pythia-foundations # Online location of your book + url: https://github.com/ProjectPythia/pythia-foundations # Online location of your book #path_to_book: docs # Optional path to your book, relative to the repository root - branch: main # Which branch of the repository should be used when creating links (optional) + branch: main # Which branch of the repository should be used when creating links (optional) # Configure your Binder links, such as the URL of the BinderHub. launch_buttons: - binderhub_url : https://mybinder.org + binderhub_url: https://mybinder.org # Add GitHub buttons to your book # See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository diff --git a/_toc.yml b/_toc.yml index aa4115ab2..ac3961c11 100644 --- a/_toc.yml +++ b/_toc.yml @@ -5,30 +5,30 @@ - part: Preamble chapters: - - file: preamble/how-to-use - - file: preamble/how-to-contribute + - file: preamble/how-to-use + - file: preamble/how-to-contribute - part: Foundational skills chapters: - - file: foundations/overview - - file: foundations/basic-python - sections: - - file: foundations/Hello - - file: foundations/jupyter - - file: foundations/markdown - - file: foundations/conda - - file: foundations/version-control - sections: - - file: foundations/git - - file: foundations/github + - file: foundations/overview + - file: foundations/basic-python + sections: + - file: foundations/Hello + - file: foundations/jupyter + - file: foundations/markdown + - file: foundations/conda + - file: foundations/version-control + sections: + - file: foundations/git + - file: foundations/github - part: Core Scientific Python packages chapters: - - file: core/overview - - file: core/numpy - - file: core/matplotlib - - file: core/cartopy - - file: core/datetime - - file: core/pandas - - file: core/data-formats - - file: core/xarray + - file: core/overview + - file: core/numpy + - file: core/matplotlib + - file: core/cartopy + - file: core/datetime + - file: core/pandas + - file: core/data-formats + - file: core/xarray diff --git a/core/pandas.md b/core/pandas.md index 027f4ab9f..8f5348f5e 100644 --- a/core/pandas.md +++ b/core/pandas.md @@ -4,4 +4,4 @@ This content is under construction! ``` -This section will contain tutorials on using [pandas](https://pandas.pydata.org) for labeled tabular data. +This section will contain tutorials on using [pandas](https://pandas.pydata.org) for labeled tabular data. diff --git a/images/ProjectPythia_Logo_Final-01-Blue-NoText.svg b/images/ProjectPythia_Logo_Final-01-Blue-NoText.svg index 4e6ea180d..53ae42f15 100644 --- a/images/ProjectPythia_Logo_Final-01-Blue-NoText.svg +++ b/images/ProjectPythia_Logo_Final-01-Blue-NoText.svg @@ -25,4 +25,4 @@ - \ No newline at end of file + diff --git a/images/ProjectPythia_Logo_Final-01-Blue.svg b/images/ProjectPythia_Logo_Final-01-Blue.svg index f88cbd073..961efc26a 100644 --- a/images/ProjectPythia_Logo_Final-01-Blue.svg +++ b/images/ProjectPythia_Logo_Final-01-Blue.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/landing-page.md b/landing-page.md index 187b8e110..dc2dc9c54 100644 --- a/landing-page.md +++ b/landing-page.md @@ -1,5 +1,4 @@ -Project Pythia Foundations -========================== +# Project Pythia Foundations Brought to you by [Project Pythia](https://projectpythia.org), this collection will cover the foundational skills everyone needs to get started with scientific computing in the open-source Python ecosystem. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..b05d384bc --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,15 @@ +[tool.black] +line-length = 88 +target-version = ['py38'] +skip-string-normalization = true + +[tool.nbqa.config] +isort = "setup.cfg" +black = "pyproject.toml" + +[tool.nbqa.mutate] +black = 1 +pyupgrade = 1 + +[tool.nbqa.addopts] +pyupgrade = ["--py36-plus"] diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..5e3e2a519 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,16 @@ +[flake8] +exclude = +ignore = +max-line-length = 88 +max-complexity = 18 +select = B,C,E,F,W,T4,B9 + +[isort] +known_first_party= +known_third_party= +multi_line_output=3 +include_trailing_comma=True +force_grid_wrap=0 +combine_as_imports=True +line_length=88 +skip=