diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 00000000..0d64b3ca --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,12 @@ +[bumpversion] +current_version = 0.0.11 +commit = True +tag = True + +[bumpversion:file:setup.py] +search = version='{current_version}' +replace = version='{new_version}' + +[bumpversion:file:piel/__init__.py] +search = __version__ = '{current_version}' +replace = __version__ = '{new_version}' diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..407cb68b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,15 @@ +* piel version: +* Python version: +* Operating System: + +### Description + +Describe what you were trying to get done. +Tell us what happened, what went wrong, and what you expected to happen. + +### What I Did + +``` +Paste the command(s) you ran and the output. +If there was a crash, please include the traceback here. +``` diff --git a/.github/workflows/create_release.yaml b/.github/workflows/create_release.yaml new file mode 100644 index 00000000..265e9285 --- /dev/null +++ b/.github/workflows/create_release.yaml @@ -0,0 +1,142 @@ +name: Create Release + +permissions: + contents: write + +on: + push: + branches: + - master + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install bump2version bumpversion # Install bump2version if not already installed + + - name: Bump version + env: + GITHUB_USERNAME: daquintero + GITHUB_EMAIL: darioaquintero@gmail.com + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Use the appropriate bumpversion command for your project + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + bump2version patch # Minor increase + export VERSION=$(bumpversion --dry-run --list setup.py | grep '^new_version=' | sed -r 's/^new_version=//') + echo "VERSION=$VERSION" >> $GITHUB_ENV + git tag -d v$VERSION + git tag v$VERSION + +# - name: Bump version and push tag +# uses: jaumann/github-bumpversion-action@v0.0.7 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# - name: Set version as environment variable +# run: | +# export VERSION=$(bumpversion --list setup.py | grep '^new_version=' | sed -r 's/^new_version=//') +# echo $VERSION + +# - name: Commit files +# env: +# GITHUB_USERNAME: daquintero +# GITHUB_EMAIL: darioaquintero@gmail.com +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# run: | +# git config --local user.email "darioaquintero@gmail.com" +# git config --local user.name "daquintero" +# git commit -am "UP: BumpVersion v${{ env.VERSION }}" +# +# - name: Commit files +# run: | +# git tag v$VERSION +# git commit -a -m "PYPI: v$VERSION" +# git config --local user.email "github-actions[bot]@users.noreply.github.com" +# git config --local user.name "github-actions[bot]" + + - name: Push changes + env: + GITHUB_USERNAME: daquintero + GITHUB_EMAIL: darioaquintero@gmail.com + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + tags: true + + - name: Create release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ env.VERSION }} # Use the incremented version as the tag name + release_name: ${{ env.VERSION }} # Customize the release name + body: | + Update PYPI ${{ env.VERSION }} + draft: false + release: true + +#name: Create Release +# +#on: +# push: +# branches: +# - master +# +#permissions: +# contents: write +# +#jobs: +# create_release: +# runs-on: ubuntu-latest +# +# steps: +# - name: Checkout code +# uses: actions/checkout@v2 +# +# - name: Set up Python +# uses: actions/setup-python@v2 +# with: +# python-version: 3.x +# +# - name: Install dependencies +# run: | +# python -m pip install --upgrade pip +# pip install bumpversion # Install bumpversion if not already installed +# +# - name: Bump version +# env: +# GITHUB_USERNAME: daquintero +# GITHUB_EMAIL: darioaquintero@gmail.com +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# run: | +# # Use the appropriate bumpversion command for your project +# bumpversion patch # Minor increase +# +# - name: Set version as environment variable +# run: | +# export VERSION=$(bumpversion --dry-run --list | grep '^new_version=' | sed -r 's/^new_version=//') +# +# - name: Create release +# uses: actions/create-release@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# tag_name: v${{ env.VERSION }} # Use the incremented version as the tag name +# release_name: Release ${{ env.VERSION }} # Customize the release name +# body: | +# Update PYPI v${{ env.VERSION }} +# draft: false +# prerelease: false diff --git a/.github/workflows/python_publish.yml b/.github/workflows/python_publish.yml index 1c6caa42..2eed8e81 100644 --- a/.github/workflows/python_publish.yml +++ b/.github/workflows/python_publish.yml @@ -7,31 +7,34 @@ # documentation. name: Upload Python Package - on: - release: - types: [published] + workflow_run: + workflows: ["create_release"] + types: + - completed permissions: contents: read jobs: deploy: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 + - name: Set up Python uses: actions/setup-python@v3 with: python-version: '3.x' + - name: Install dependencies run: | python -m pip install --upgrade pip pip install build + - name: Build package run: python -m build + - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..abf0f9c0 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,38 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: ca84e500209b3757213759d4d522f8ed307cd638 + hooks: + - id: check-yaml + exclude: ^(conda\.recipe/meta\.yaml|conda_build/templates/.*\.yaml|docs/click/meta\.yaml|conda/meta\.yaml|conda/construct.yaml|.*\.pic\.yml|conda/constructor/Miniforge3/construct.yaml) + - id: end-of-file-fixer + - id: trailing-whitespace + + - repo: https://github.com/psf/black + rev: 23.3.0 + hooks: + - id: black + + - repo: https://github.com/asottile/blacken-docs + rev: 7b71075ceb458be255e24da587c0275818b51faa + hooks: + - id: blacken-docs + additional_dependencies: [black==23.3.0] + + - repo: https://github.com/codespell-project/codespell + rev: ad3ff374e97e29ca87c94b5dc7eccdd29adc6296 + hooks: + - id: codespell + args: ["-L TE,TE/TM,te,ba,FPR,fpr_spacing,ro,nd,donot,schem"] + additional_dependencies: + - tomli + + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: "7c149cf0b9d2c4f7558de1ea5d2c137ca074d9d0" + hooks: + - id: ruff + + - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: d2425a62376c2197448cce2f825d5a0c3926b862 + hooks: + - id: pretty-format-toml + args: [--autofix] diff --git a/.travis.yml b/.travis.yml index d3484763..3d59c2cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ # Config file for automatic testing at travis-ci.com -language: python -python: - - 3.8 - - 3.7 - - 3.6 +#language: python +#python: +# - 3.8 +# - 3.7 +# - 3.6 env: - MY_SECRET=$TRAVIS_KEY @@ -15,17 +15,20 @@ install: pip install -U tox-travis # Command to run tests, e.g. python setup.py test script: tox -# Assuming you have installed the travis-ci CLI tool, after you -# create the Github repo and add it to Travis, run the -# following command to finish PyPI deployment setup: -# $ travis encrypt --add deploy.password -deploy: - provider: pypi - distributions: sdist bdist_wheel - user: ${{ secrets.PYPI_USERNAME }}" - password: - secure: ${{ secrets.PYPI_PASSWORD }}" - on: - tags: true - repo: daquintero/piel - python: 3.8 +## Assuming you have installed the travis-ci CLI tool, after you +## create the Github repo and add it to Travis, run the +## following command to finish PyPI deployment setup: +## $ travis encrypt --add deploy.password + + + +#deploy: +# provider: pypi +# distributions: sdist bdist_wheel +# user: ${{ secrets.PYPI_USERNAME }}" +# password: +# secure: ${{ secrets.PYPI_PASSWORD }}" +# on: +# tags: true +# repo: daquintero/piel +# python: 3.8 diff --git a/piel/__init__.py b/piel/__init__.py index b59bd153..78c376ee 100644 --- a/piel/__init__.py +++ b/piel/__init__.py @@ -2,4 +2,4 @@ __author__ = """Dario Quintero""" __email__ = 'darioaquintero@gmail.com' -__version__ = '0.0.1' +__version__ = '0.0.11' diff --git a/.readthedocs.yaml b/readthedocs.yaml similarity index 94% rename from .readthedocs.yaml rename to readthedocs.yaml index 0c8da513..20a56164 100644 --- a/.readthedocs.yaml +++ b/readthedocs.yaml @@ -1,4 +1,4 @@ -# .readthedocs.yaml +# readthedocs.yaml # Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details @@ -27,6 +27,6 @@ sphinx: # Optional but recommended, declare the Python requirements required # to build your documentation # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html - python: - install: +python: + install: - requirements: requirements_dev.txt diff --git a/setup.cfg b/setup.cfg index 6e8e8b71..59398ab8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,16 +1,3 @@ -[bumpversion] -current_version = 0.0.1 -commit = True -tag = True - -[bumpversion:file:setup.py] -search = version='{current_version}' -replace = version='{new_version}' - -[bumpversion:file:piel/__init__.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' - [bdist_wheel] universal = 1 diff --git a/setup.py b/setup.py index a1a28704..556bc517 100644 --- a/setup.py +++ b/setup.py @@ -59,6 +59,6 @@ test_suite='tests', tests_require=test_requirements, url='https://github.com/daquintero/piel', - version='0.0.2', + version='0.0.11', zip_safe=False, )