Skip to content

Commit

Permalink
Merge pull request #256 from knaaptime/infrastructure
Browse files Browse the repository at this point in the history
update to pyproject
  • Loading branch information
sjsrey authored Aug 4, 2023
2 parents 8eec2a0 + cbab9ee commit 6812517
Show file tree
Hide file tree
Showing 15 changed files with 181 additions and 2,973 deletions.
2 changes: 0 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ omit =
docs/conf.py
setup.py
*/tests/*
versioneer.py
*_version.py

[html]
directory = coverage_html_report
16 changes: 16 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- dependabot
categories:
- title: Bug Fixes
labels:
- bug
- title: Enhancements
labels:
- enhancement
- title: Other Changes
labels:
- "*"
109 changes: 44 additions & 65 deletions .github/workflows/upload_package.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,45 @@
name: Release Package

# Release package on GitHub and publish to PyPI

# Important: In order to trigger this workflow for the organization
# repo (organzation-name/repo-name vs. user-name/repo-name), a tagged
# commit must be made to *organzation-name/repo-name*. If the tagged
# commit is made to *user-name/repo-name*, a release will be published
# under the user's name, not the organzation.

#--------------------------------------------------
name: Release & Publish

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build:
name: Create release & publish to PyPI
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine jupyter urllib3 pandas pyyaml
python setup.py sdist bdist_wheel
- name: run Changelog
run: |
jupyter nbconvert --to notebook --execute --inplace --ExecutePreprocessor.timeout=-1 --ExecutePreprocessor.kernel_name=python3 tools/gitcount.ipynb
- name: cat Changelog
uses: pCYSl5EDgo/cat@master
id: changetxt
with:
path: ./tools/changelog.md
env:
TEXT: ${{ steps.changetxt.outputs.text }}

- name: Get the tag name
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: Release
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.changetxt.outputs.text }}
body_path: ${{ steps.changetxt.outputs.path }}
name: Release ${{ env.TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
inputs:
version:
description: Manual Release
default: test
required: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine jupyter urllib3 pandas pyyaml
python setup.py sdist bdist_wheel
- name: Create Release Notes
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.pyc
.ipynb_checkpoints/
.DS_Store
.vscode/

# Packages
*.egg
Expand Down
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

17 changes: 11 additions & 6 deletions esda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
=================================================
"""
from . import _version, adbscan, shape # noqa F401

import contextlib
from importlib.metadata import PackageNotFoundError, version

from . import adbscan, shape # noqa F401
from .gamma import Gamma # noqa F401
from .geary import Geary # noqa F401
from .geary_local import Geary_Local # noqa F401
Expand All @@ -15,18 +19,18 @@
from .join_counts_local_mv import Join_Counts_Local_MV # noqa F401
from .lee import Spatial_Pearson, Spatial_Pearson_Local # noqa F401
from .losh import LOSH # noqa F401
from .map_comparison import ( # noqa F401
from .map_comparison import (
areal_entropy,
completeness,
completeness, # noqa F401
external_entropy,
homogeneity,
overlay_entropy,
)
from .moran import ( # noqa F401
from .moran import (
Moran,
Moran_BV,
Moran_BV_matrix,
Moran_Local,
Moran_Local, # noqa F401
Moran_Local_BV,
Moran_Local_Rate,
Moran_Rate,
Expand All @@ -36,4 +40,5 @@
from .topo import isolation, prominence # noqa F401
from .util import fdr # noqa F401

__version__ = _version.get_versions()["version"]
with contextlib.suppress(PackageNotFoundError):
__version__ = version("esda")
Loading

0 comments on commit 6812517

Please sign in to comment.