-
Notifications
You must be signed in to change notification settings - Fork 31
Modern python structure #29
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| codecov: | ||
| notify: | ||
| after_n_builds: 5 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| node: $Format:%H$ | ||
| node-date: $Format:%cI$ | ||
| describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ | ||
| ref-names: $Format:%D$ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| version: 2 | ||
| updates: | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After having had more experience, I would now recommend against dependabot for projects that are not in constant sprint. Instead |
||
| - package-ecosystem: pip | ||
| directory: "/" | ||
| schedule: | ||
| interval: daily | ||
| open-pull-requests-limit: 10 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| upload-wheel: | ||
| type: boolean | ||
| required: false | ||
| default: false | ||
| description: Upload wheel as an artifact | ||
| pull_request: | ||
| branches: [ main ] | ||
| push: | ||
| branches: [ main ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| tests: | ||
| uses: ./.github/workflows/step_test.yaml | ||
|
|
||
| build-wheel: | ||
| uses: ./.github/workflows/step_build-wheel.yaml | ||
| needs: [ tests ] | ||
| with: | ||
| upload: ${{ inputs.upload-wheel || false }} | ||
| pass: | ||
| needs: [tests, build-wheel] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check all CI action | ||
| uses: re-actors/alls-green@release/v1 | ||
| with: | ||
| jobs: ${{ toJSON(needs) }} | ||
| if: always() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: Prepare release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v[0-9]+.[0-9]+.[0-9]+" | ||
| - "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" | ||
| workflow_dispatch: | ||
| inputs: | ||
| ref: | ||
| description: Tag to release | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| tests: | ||
| uses: ./.github/workflows/step_test.yaml | ||
| build-wheel: | ||
| needs: [ tests ] | ||
| uses: ./.github/workflows/step_build-wheel.yaml | ||
| with: | ||
| ref: ${{ inputs.ref }} | ||
| upload_pypi: | ||
| name: Upload to PyPI repository | ||
| needs: [ tests, build-wheel ] | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/project/click-option-group/ | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/download-artifact@v3 | ||
| with: | ||
| name: artifact | ||
| path: dist | ||
| - name: Publish package to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| release: | ||
| needs: [ upload_pypi ] | ||
| name: Create release | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: softprops/action-gh-release@v1 | ||
| with: | ||
| name: click-option-group ${{ github.ref_name }} | ||
| prerelease: ${{ contains(github.ref, 'rc') }} | ||
| generate_release_notes: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| upload: | ||
| description: Upload wheel as artifact | ||
| required: false | ||
| type: boolean | ||
| default: true | ||
| ref: | ||
| description: Tag to release | ||
| required: false | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ inputs.ref }} | ||
| - name: Build package | ||
| run: pipx run build | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This workflow should be revisited to use |
||
| - uses: actions/upload-artifact@v3 | ||
| with: | ||
| path: dist/* | ||
| if: ${{ inputs.upload }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| on: | ||
| workflow_call: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| tests: | ||
| name: Check with Python ${{ matrix.python-version }} ${{ matrix.experimental && '(Experimental)' }} | ||
| needs: [ pre-commit ] | ||
| continue-on-error: ${{ matrix.experimental || false }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ] | ||
| include: | ||
| - python-version: "3.12" | ||
| experimental: true | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| allow-prereleases: true | ||
|
|
||
| - name: Install package | ||
| run: pip install -e .[test-cov] | ||
| - name: Test package | ||
| run: pytest --cov --cov-report=xml | ||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v3 | ||
| with: | ||
| name: python ${{ matrix.python-version }} | ||
| flags: python-${{ matrix.python-version }} | ||
|
|
||
| pass: | ||
| needs: [ tests ] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check test jobs | ||
| uses: re-actors/alls-green@release/v1 | ||
| with: | ||
| jobs: ${{ toJSON(needs) }} | ||
| if: always() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,6 @@ docs/_build | |
| .tox | ||
| _gitmsg.saved.txt | ||
|
|
||
|
|
||
| ### Project specific | ||
| src/fypp/_version.py | ||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| [build-system] | ||
| requires = ["hatchling", "hatch-vcs"] | ||
| build-backend = "hatchling.build" | ||
|
|
||
| [project] | ||
| name = "fypp" | ||
| description = "Python powered Fortran preprocessor" | ||
| dynamic = ["version"] | ||
| authors = [ | ||
| { name = "Bálint Aradi", email = "aradi@uni-bremen.de" }, | ||
| ] | ||
| requires-python = ">=3.5" | ||
| license = { text = "BSD-2-Clause" } | ||
| license-files = { paths = ["LICENSE.txt"] } | ||
| readme = "README.rst" | ||
|
|
||
| classifiers = [ | ||
| 'Development Status :: 5 - Production/Stable', | ||
| 'Intended Audience :: Developers', | ||
| 'Intended Audience :: Science/Research', | ||
| 'Topic :: Software Development :: Code Generators', | ||
| 'Topic :: Software Development :: Pre-processors', | ||
| "Programming Language :: Python", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3 :: Only", | ||
| 'Programming Language :: Python :: 3.5', | ||
| 'Programming Language :: Python :: 3.6', | ||
| '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", | ||
| ] | ||
| keywords=[ | ||
| "fortran", | ||
| "metaprogramming", | ||
| "pre-processor", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| homepage = "https://github.com/aradi/fypp" | ||
| documentation = "https://fypp.readthedocs.io/" | ||
| repository = "https://github.com/aradi/fypp" | ||
|
|
||
| [project.scripts] | ||
| fypp = "fypp.cli:run_fypp" | ||
|
|
||
| [project.optional-dependencies] | ||
| test = [ | ||
| "pytest", | ||
| ] | ||
| test-cov = [ | ||
| "fypp[test]", | ||
| "pytest-cov", | ||
| ] | ||
| docs = [ | ||
| "sphinx", | ||
| "sphinx-rtd-theme", | ||
| ] | ||
| dev = [ | ||
| "fypp[test]", | ||
| ] | ||
|
|
||
| [tool.hatch] | ||
| version.source = "vcs" | ||
| build.hooks.vcs.version-file = "src/fypp/_version.py" | ||
|
|
||
| [tool.pytest.ini_options] | ||
| testpaths = ["test"] | ||
| python_files = "test_*.py" | ||
|
|
||
| [tool.tox] | ||
| legacy_tox_ini = """ | ||
| [tox] | ||
| envlist = py34, py35, py36, py37, py38, py39 | ||
|
|
||
| [testenv] | ||
| skip_missing_interpreters = | ||
| true | ||
| setenv = | ||
| PYTHONPATH = {toxinidir}/src | ||
| changedir=test | ||
| commands=python test_fypp.py | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line must be removed