Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pyproject.toml instead of setup.cfg, pytest.ini & requirements.txt and other Python related config files #276

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ charset = utf-8
trim_trailing_whitespace=true

[**.{c,cpp,h,hpp}]
indent_style = tab
indent_size = 4
indent_style = space
indent_size = 2

[**.{py}]
indent_style = space
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,3 @@ jobs:
file: packaging/Docker/Dockerfile.manylinux
push: true
tags: sogno/dpsim:manylinux

4 changes: 2 additions & 2 deletions .github/workflows/documentation-fein.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master

jobs:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Deploy dpsim-simulator / FEIN
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.HUGO_ACTIONS_DEPLOY_KEY }}
deploy_key: ${{ secrets.HUGO_ACTIONS_DEPLOY_KEY }}
external_repository: dpsim-simulator/dpsim-simulator.github.io
publish_dir: ./docs/hugo/public
# keep_files: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
path: ${{ github.workspace }}/reference
name: reference-cache
retention-days: 1

deploy:
runs-on: ubuntu-latest
needs: [generate-reference]
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Deploy page
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
# keep_files: true
publish_branch: gh-pages
publish_branch: gh-pages
14 changes: 14 additions & 0 deletions .github/workflows/pre_commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Run pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.1
17 changes: 6 additions & 11 deletions .github/workflows/publish_to_pypi.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish dpsim package to PyPi
name: Publish DPsim package to Python Package Index (PyPI)

on:
push:
Expand All @@ -9,7 +9,7 @@ on:

jobs:
build-and-publish-sdist:
name: Build dpsim sdist and publish to PyPi
name: Build DPsim source distribution and publish to PyPi
runs-on: ubuntu-latest
container: sogno/dpsim:dev
steps:
Expand All @@ -18,7 +18,7 @@ jobs:
with:
submodules: recursive

- name: Build dpsim source dist
- name: Build DPsim source distribution
shell: bash
run: python3 -m build --sdist --outdir dist/

Expand All @@ -35,21 +35,16 @@ jobs:
with:
password: ${{ secrets.PYPI_API_TOKEN }}


build-and-publish-wheels:
name: Build dpsim wheels and publish to PyPi
name: Build DPsim wheels and publish to PyPI
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

# - name: Build manylinux docker image # Remove this step as soon as the image is published on docker hub
# shell: bash
# run: docker build . --file packaging/Docker/Dockerfile.manylinux -t sogno/dpsim:manylinux

- name: Build dpsim wheels for all supported python versions
- name: Build DPsim wheels for all supported Python versions
uses: pypa/cibuildwheel@v2.11.2
with:
output-dir: dist
Expand All @@ -65,4 +60,4 @@ jobs:
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/run_and_profile_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ jobs:

- name: Run Binary
run: ${{ inputs.path }} 2>&1 | tee output.log

- name: Extract metrics
shell: bash
working-directory: ${{ github.workspace }}
run: |
cat output.log |
sed -n -E -e 's/^.*Average step time. ([0-9]+\.[0-9]+)$/step-time \1/p' |
tee -a metrics.txt

- name: Run Profiler
run: gprof ${{ inputs.path }} | gprof2dot -s | dot -Tpng -o profiling.png || true

Expand All @@ -45,4 +45,4 @@ jobs:
name: profiler-output-${{ inputs.name }}
path: |
metrics.txt
profiling.png
profiling.png
4 changes: 2 additions & 2 deletions .github/workflows/sonar_cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
run: |
mkdir -p $HOME/.sonar
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
- name: Download and set up build-wrapper
Expand Down Expand Up @@ -56,4 +56,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
Loading
Loading