Skip to content

Commit

Permalink
MAINT: Python 3.11, src layout, and other updates (#25)
Browse files Browse the repository at this point in the history
- src layout
- setuptools_scm instead of versioneer.py
- update tests to remove warnings
- do not track _version.py
- remove 3.7 support
  • Loading branch information
stefan-jansen authored Jan 12, 2023
1 parent b391608 commit 6958c1d
Show file tree
Hide file tree
Showing 58 changed files with 567 additions and 2,915 deletions.
13 changes: 13 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[flake8]
exclude =
.git,
.pytest_cache
conda,
_sources,
__pycache__,
docs/source/conf.py,
src/pyfolio/_version.py
max-line-length = 88
max-complexity = 18
select = B,C,E,F,W,T4,B9
ignore = E203, E266, E501, W503, F403, F401, E231
25 changes: 13 additions & 12 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ name: PyPI
on:
workflow_dispatch:
inputs:
target:
description: 'Package Index'
publish_to_pypi:
description: 'Publish to PyPI?'
required: true
default: 'TESTPYPI'
release:
types:
- published
type: boolean
default: 'false'

jobs:
dist:
Expand All @@ -18,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ 3.8 ]
python-version: [ 3.10 ]

steps:
- name: Checkout pyfolio
Expand All @@ -45,21 +43,24 @@ jobs:
upload_pypi:
needs: [ dist ]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: publish to testpypi
uses: pypa/gh-action-pypi-publish@master
if: ${{ github.event.inputs.target }} == 'TESTPYPI'
uses: pypa/gh-action-pypi-publish@release/v1
if: inputs.publish_to_pypi == 'false'
with:
user: __token__
password: ${{ secrets.TESTPYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: publish to pypi
uses: pypa/gh-action-pypi-publish@master
if: ${{ github.event.inputs.target }} == 'PYPI' || (github.event_name == 'release' && github.event.action == 'published')
uses: pypa/gh-action-pypi-publish@release/v1
if: inputs.publish_to_pypi == 'true'
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest , windows-latest, macos-latest ]
python-version: [ 3.7, 3.8, 3.9 ]
python-version: [ 3.8, 3.9, '3.10', '3.11']
steps:
- name: Checkout pyfolio
uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ target/
.ipynb_checkpoints/

.idea
src/pyfolio/_version.py
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ repos:
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.1
hooks:
- id: flake8

- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.3.0
hooks:
- id: black

Expand Down
Loading

0 comments on commit 6958c1d

Please sign in to comment.