Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Commit

Permalink
chore: clean up (#10)
Browse files Browse the repository at this point in the history
### Summary of Changes

* Remove some outdated linter configs
* Move linter config to `pyproject.toml` where possible
* Move `pyproject.toml` and `poetry.lock` to top-level to be able to
reuse `README.md` in `docs/`
* Specify dependencies to build documentation using `poetry`
  • Loading branch information
lars-reimann authored Mar 13, 2023
1 parent 6f70337 commit 68d0e1c
Show file tree
Hide file tree
Showing 20 changed files with 3,191 additions and 1,186 deletions.
2 changes: 0 additions & 2 deletions .bandit.yml

This file was deleted.

10 changes: 1 addition & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,7 @@ updates:
directory: '/'
schedule:
interval: 'monthly'

# docs
- package-ecosystem: 'pip'
directory: '/docs'
schedule:
interval: 'monthly'

# src
- package-ecosystem: 'pip'
directory: '/src'
directory: '/'
schedule:
interval: 'monthly'
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
python-version: [ "3.10" ]
uses: lars-reimann/.github/.github/workflows/poetry-codecov-reusable.yml@main
with:
working-directory: src
working-directory: .
python-version: ${{ matrix.python-version }}
module-name: safeds_examples
2 changes: 1 addition & 1 deletion .github/workflows/merge_queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
python-version: [ "3.10" ]
uses: lars-reimann/.github/.github/workflows/poetry-codecov-reusable.yml@main
with:
working-directory: src
working-directory: .
python-version: ${{ matrix.python-version }}
module-name: safeds_examples
coverage: false
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
python-version: [ "3.10" ]
uses: lars-reimann/.github/.github/workflows/poetry-codecov-reusable.yml@main
with:
working-directory: src
working-directory: .
python-version: ${{ matrix.python-version }}
module-name: safeds_examples
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
release:
uses: lars-reimann/.github/.github/workflows/poetry-pypi-reusable.yml@main
with:
working-directory: src
working-directory: .
python-version: "3.10"
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ venv/
.pytest_cache/
htmlcov/
.coverage
coverage.xml

# mkdocs
/site/

# MegaLinter
report/
Expand Down
4 changes: 0 additions & 4 deletions .mypy.ini

This file was deleted.

4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[![PyPI](https://img.shields.io/pypi/v/safe-ds-examples)](https://pypi.org/project/safe-ds-examples/)
[![Main](https://github.com/Safe-DS/Stdlib-Examples/actions/workflows/main.yml/badge.svg)](https://github.com/Safe-DS/Stdlib-Examples/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/Safe-DS/Stdlib-Examples/branch/main/graph/badge.svg?token=X5CU9V952H)](https://codecov.io/gh/Safe-DS/Stdlib-Examples)
[![Documentation Status](https://readthedocs.org/projects/stdlib-examples/badge/?version=latest)](https://stdlib-examples.readthedocs.io/en/latest/?badge=latest)
[![Documentation Status](https://readthedocs.org/projects/stdlib-examples/badge/?version=latest)](https://stdlib-examples.safe-ds.com)

Ready-to-use examples for the [Safe-DS Python Library](https://github.com/Safe-DS/Stdlib).

You can find the full documentation [here](https://stdlib-examples.readthedocs.io/).
You can find the full documentation [here](https://stdlib-examples.safe-ds.com).
9 changes: 0 additions & 9 deletions docs/requirements.txt

This file was deleted.

3,150 changes: 3,150 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

22 changes: 20 additions & 2 deletions src/pyproject.toml → pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ version = "0.1.0"
description = "Ready-to-use examples for the Safe-DS Python library."
license = "MIT"
authors = ["Lars Reimann <[email protected]>"]
readme = "README.md"
readme = "docs/README.md"
repository = "https://github.com/Safe-DS/Stdlib-Examples"
documentation = "https://stdlib-examples.safe-ds.com"
keywords = ["data science", "machine learning", "usability", "learnability"]
packages = [
{ include = "safeds_examples" },
{ include = "safeds_examples", from = "src" },
]

[tool.poetry.dependencies]
Expand All @@ -19,6 +20,23 @@ safe-ds = "^0.2.0"
pytest = "^7.2.1"
pytest-cov = "^4.0.0"

[tool.poetry.group.docs.dependencies]
jupyter = "^1.0.0"
mkdocs = "^1.4.2"
mkdocstrings = "^0.20.0"
mkdocstrings-python = "^0.8.3"
mkdocs-autorefs = "^0.4.1"
mkdocs-gen-files = "^0.4.0"
mkdocs-glightbox = "^0.3.1"
mkdocs-literate-nav = "^0.6.0"
mkdocs-material = "^9.1.2"
mkdocs-section-index = "^0.3.5"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.mypy]
disallow_incomplete_defs = true
disallow_untyped_defs = true
ignore_missing_imports = true
13 changes: 7 additions & 6 deletions readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ build:
os: ubuntu-22.04
tools:
python: '3.10'
jobs:
# https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry
post_create_environment:
- pip install poetry
- poetry config virtualenvs.create false
post_install:
- poetry install --with docs

mkdocs:
configuration: mkdocs.yml

python:
install:
- requirements: docs/requirements.txt
- method: pip
path: src
7 changes: 3 additions & 4 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,21 @@ module.exports = {
verifyConditionsCmd: `if [ 403 != $(curl -X POST -F ':action=file_upload' -u __token__:$PYPI_TOKEN -s -o /dev/null -w '%{http_code}' ${PYPI_REPOSITORY}) ]; then (exit 0); else (echo 'Authentication error. Please check the PYPI_TOKEN environment variable.' && exit 1); fi`,
prepareCmd: 'poetry version ${nextRelease.version}',
publishCmd: 'poetry publish --build --username __token__ --password $PYPI_TOKEN --no-interaction -vvv',
execCwd: 'src',
},
],
[
'@semantic-release/github',
{
assets: [
{ path: 'src/dist/*.tar.gz', label: 'sdist' },
{ path: 'src/dist/*.whl', label: 'wheel' },
{ path: 'dist/*.tar.gz', label: 'sdist' },
{ path: 'dist/*.whl', label: 'wheel' },
],
},
],
[
'@semantic-release/git',
{
assets: ['src/pyproject.toml', 'docs/CHANGELOG.md'],
assets: ['pyproject.toml', 'docs/CHANGELOG.md'],
},
],
],
Expand Down
8 changes: 0 additions & 8 deletions src/README.md

This file was deleted.

Loading

0 comments on commit 68d0e1c

Please sign in to comment.