Skip to content

Commit

Permalink
chore: clean up (#34)
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 d72a529 commit 4adbf5e
Show file tree
Hide file tree
Showing 210 changed files with 3,170 additions and 1,176 deletions.
2 changes: 0 additions & 2 deletions .bandit.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,3 @@ insert_final_newline = true

[{*.yaml,*.yml}]
indent_size = 2

[*.{kt,kts}]
ktlint_standard_filename = disabled
kltint_experimental_property-naming = disabled
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
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
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
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
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.

9 changes: 0 additions & 9 deletions docs/requirements.txt

This file was deleted.

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

Large diffs are not rendered by default.

23 changes: 20 additions & 3 deletions src/pyproject.toml → pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ version = "0.2.0"
description = "A user-friendly library for Data Science in Python."
authors = ["Lars Reimann <[email protected]>"]
license = "MIT"
readme = "README.md"
readme = "docs/README.md"
repository = "https://github.com/Safe-DS/Stdlib"
documentation = "https://safe-ds-stdlib.readthedocs.io"
keywords = ["data science", "machine learning", "usability", "learnability"]
packages = [
{ include = "safeds" },
{ include = "safeds", from = "src"},
]

[tool.poetry.dependencies]
Expand All @@ -20,10 +20,27 @@ seaborn = "^0.12.2"
ipython = "^8.8.0"
matplotlib = "^3.6.3"

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
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>=1.0.0"]
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
12 changes: 0 additions & 12 deletions src/README.md

This file was deleted.

Loading

0 comments on commit 4adbf5e

Please sign in to comment.