From ed1ff928c69f9232fdd5d1f50f6a9958019a698c Mon Sep 17 00:00:00 2001 From: Serge Date: Mon, 28 Dec 2020 19:47:11 -0800 Subject: [PATCH 1/2] Prepping for 2.3.2 release. --- .github/workflows/upload_package.yml | 62 ++++++ esda/__init__.py | 2 +- tools/gitcount.ipynb | 297 +++++++++++++++++---------- 3 files changed, 256 insertions(+), 105 deletions(-) create mode 100644 .github/workflows/upload_package.yml diff --git a/.github/workflows/upload_package.yml b/.github/workflows/upload_package.yml new file mode 100644 index 00000000..e4961be2 --- /dev/null +++ b/.github/workflows/upload_package.yml @@ -0,0 +1,62 @@ +name: Release Package + +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: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python + uses: actions/setup-python@v1 + 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: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.pypi_password }} + - 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: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: ${{ steps.changetxt.outputs.text }} + draft: false + prerelease: false + - name: Get Asset name + run: | + export PKG=$(ls dist/) + set -- $PKG + echo "name=$1" >> $GITHUB_ENV + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: dist/${{ env.name }} + asset_name: ${{ env.name }} + asset_content_type: application/zip diff --git a/esda/__init__.py b/esda/__init__.py index 5c00b288..58cac49d 100644 --- a/esda/__init__.py +++ b/esda/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.3.1" +__version__ = "2.3.2" """ :mod:`esda` --- Exploratory Spatial Data Analysis ================================================= diff --git a/tools/gitcount.ipynb b/tools/gitcount.ipynb index 0d5fd243..ff40153e 100644 --- a/tools/gitcount.ipynb +++ b/tools/gitcount.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## PySAL Change Log Statistics\n", + "## `tobler` Change Log Statistics\n", "\n", "This notebook generates the summary statistics for a package. \n", "\n", @@ -12,22 +12,52 @@ "\n" ] }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [], + "source": [ + "# get date of last tag\n", + "from subprocess import Popen, PIPE\n", + "x, err = Popen('git log -1 --tags --simplify-by-decoration --pretty=\"%ai\"| cat', stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True).communicate()\n", + "start_date = x.split()[0].decode('utf-8')" + ] + }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Change the values only in the next cell" + "If you need to manually re-generate the changelog, uncomment the following cell and enter in the desired start date" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [], + "source": [ + "start_date = '2020-07-11'" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [], + "source": [ + "# today's date\n", + "import datetime\n", + "release_date = str(datetime.datetime.today()).split()[0]" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 41, "metadata": {}, "outputs": [], "source": [ - "package_name = 'esda'\n", - "release_date = '2020-02-01'\n", - "start_date = '2019-12-18'" + "package_name = 'esda'" ] }, { @@ -39,7 +69,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 42, "metadata": {}, "outputs": [], "source": [ @@ -66,7 +96,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 43, "metadata": {}, "outputs": [], "source": [ @@ -75,7 +105,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 44, "metadata": {}, "outputs": [ { @@ -84,7 +114,7 @@ "'/home/serge/Dropbox/p/pysal/src/subpackages/esda/tools'" ] }, - "execution_count": 8, + "execution_count": 44, "metadata": {}, "output_type": "execute_result" } @@ -95,16 +125,16 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 45, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "datetime.datetime(2019, 12, 18, 0, 0)" + "datetime.datetime(2020, 7, 11, 0, 0)" ] }, - "execution_count": 9, + "execution_count": 45, "metadata": {}, "output_type": "execute_result" } @@ -118,7 +148,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 46, "metadata": {}, "outputs": [], "source": [ @@ -139,7 +169,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 47, "metadata": {}, "outputs": [], "source": [ @@ -149,16 +179,16 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 48, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "15" + "16" ] }, - "execution_count": 12, + "execution_count": 48, "metadata": {}, "output_type": "execute_result" } @@ -183,7 +213,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 49, "metadata": {}, "outputs": [], "source": [ @@ -206,25 +236,25 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 50, "metadata": {}, "outputs": [], "source": [ - "author_cmd = ['git', 'log', '--format=* %aN', since_date]" + "from collections import Counter" ] }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 51, "metadata": {}, "outputs": [], "source": [ - "from collections import Counter" + "author_cmd = [\"git\", \"log\", \"--format=* %aN\", since_date]" ] }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 52, "metadata": {}, "outputs": [], "source": [ @@ -239,7 +269,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 53, "metadata": {}, "outputs": [], "source": [ @@ -248,16 +278,16 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 54, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "dict_keys(['Serge Rey', 'Eli Knaap'])" + "dict_keys(['Serge Rey', 'Martin Fleischmann', 'James Gaboardi', 'Dependabot[Bot]', 'Levi John Wolf'])" ] }, - "execution_count": 18, + "execution_count": 54, "metadata": {}, "output_type": "execute_result" } @@ -275,7 +305,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 55, "metadata": {}, "outputs": [], "source": [ @@ -288,7 +318,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 56, "metadata": {}, "outputs": [], "source": [ @@ -384,7 +414,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 57, "metadata": {}, "outputs": [], "source": [ @@ -404,7 +434,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 58, "metadata": {}, "outputs": [], "source": [ @@ -416,7 +446,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 59, "metadata": {}, "outputs": [], "source": [ @@ -428,20 +458,25 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 60, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "['Fixes for pandas deprecation and 3.8 verbosity (#101)',\n", - " 'ENH: adjust tests for new libpysal.examples (#98)',\n", - " 'update docs (#97)',\n", - " 'DOC: changelog update (#96)',\n", - " 'ENH: bumping version and handle array creation error in join counts (#95)']" + "['fix concatenation for random statistics (#147)',\n", + " 'Dropping 3.6 from testing. (#152)',\n", + " 'CI: update conda setup (#151)',\n", + " 'Bump codecov/codecov-action from v1.0.13 to v1.0.14 (#149)',\n", + " 'Bump codecov/codecov-action from v1.0.12 to v1.0.13 (#144)',\n", + " 'Bump codecov/codecov-action from v1.0.11 to v1.0.12 (#140)',\n", + " 'Bump codecov/codecov-action from v1.0.10 to v1.0.11 (#138)',\n", + " '[BUG] remove README.rst (#137)',\n", + " '[DOC] Update for 2.30 (#135)',\n", + " '(BUG) missing comma in setup.py (#134)']" ] }, - "execution_count": 24, + "execution_count": 60, "metadata": {}, "output_type": "execute_result" } @@ -452,7 +487,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 61, "metadata": {}, "outputs": [], "source": [ @@ -461,7 +496,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 62, "metadata": {}, "outputs": [], "source": [ @@ -470,16 +505,16 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 63, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'We closed a total of 10 issues (enhancements and bug fixes) through 5 pull requests, since our last release on 2019-12-18.'" + "'We closed a total of 25 issues (enhancements and bug fixes) through 10 pull requests, since our last release on 2020-07-11.'" ] }, - "execution_count": 27, + "execution_count": 63, "metadata": {}, "output_type": "execute_result" } @@ -490,7 +525,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 64, "metadata": {}, "outputs": [], "source": [ @@ -499,14 +534,14 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 65, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "We closed a total of 10 issues (enhancements and bug fixes) through 5 pull requests, since our last release on 2019-12-18.\n", + "We closed a total of 25 issues (enhancements and bug fixes) through 10 pull requests, since our last release on 2020-07-11.\n", "\n", "## Issues Closed\n", "\n" @@ -519,7 +554,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 66, "metadata": {}, "outputs": [], "source": [ @@ -532,28 +567,43 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 67, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "We closed a total of 10 issues (enhancements and bug fixes) through 5 pull requests, since our last release on 2019-12-18.\n", + "We closed a total of 25 issues (enhancements and bug fixes) through 10 pull requests, since our last release on 2020-07-11.\n", "\n", "## Issues Closed\n", - " - Fixes for pandas deprecation and 3.8 verbosity (#101)\n", - " - ENH: adjust tests for new libpysal.examples (#98)\n", - " - update docs (#97)\n", - " - DOC: changelog update (#96)\n", - " - ENH: bumping version and handle array creation error in join counts (#95)\n", + " - fix concatenation for random statistics (#147)\n", + " - Dropping 3.6 from testing. (#152)\n", + " - Unexpected LISA results for polygons contained by another polygon (#153)\n", + " - CI: update conda setup (#151)\n", + " - Bump codecov/codecov-action from v1.0.14 to v1.0.15 (#150)\n", + " - Bump codecov/codecov-action from v1.0.13 to v1.0.14 (#149)\n", + " - Bump codecov/codecov-action from v1.0.12 to v1.0.13 (#144)\n", + " - Spatial cross-correlations? (#141)\n", + " - Bump codecov/codecov-action from v1.0.11 to v1.0.12 (#140)\n", + " - Bump codecov/codecov-action from v1.0.10 to v1.0.11 (#138)\n", + " - README.md missing from 2.3.0 on pypi (#136)\n", + " - [BUG] remove README.rst (#137)\n", + " - [DOC] Update for 2.30 (#135)\n", + " - Release notes for 2.3.0 (#127)\n", + " - (BUG) missing comma in setup.py (#134)\n", "\n", "## Pull Requests\n", - " - Fixes for pandas deprecation and 3.8 verbosity (#101)\n", - " - ENH: adjust tests for new libpysal.examples (#98)\n", - " - update docs (#97)\n", - " - DOC: changelog update (#96)\n", - " - ENH: bumping version and handle array creation error in join counts (#95)\n" + " - fix concatenation for random statistics (#147)\n", + " - Dropping 3.6 from testing. (#152)\n", + " - CI: update conda setup (#151)\n", + " - Bump codecov/codecov-action from v1.0.13 to v1.0.14 (#149)\n", + " - Bump codecov/codecov-action from v1.0.12 to v1.0.13 (#144)\n", + " - Bump codecov/codecov-action from v1.0.11 to v1.0.12 (#140)\n", + " - Bump codecov/codecov-action from v1.0.10 to v1.0.11 (#138)\n", + " - [BUG] remove README.rst (#137)\n", + " - [DOC] Update for 2.30 (#135)\n", + " - (BUG) missing comma in setup.py (#134)\n" ] } ], @@ -563,7 +613,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 68, "metadata": {}, "outputs": [], "source": [ @@ -572,7 +622,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 69, "metadata": {}, "outputs": [ { @@ -580,7 +630,10 @@ "output_type": "stream", "text": [ " - Serge Rey\n", - " - Eli Knaap\n" + " - Martin Fleischmann\n", + " - James Gaboardi\n", + " - Dependabot[Bot]\n", + " - Levi John Wolf\n" ] } ], @@ -590,7 +643,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 70, "metadata": {}, "outputs": [], "source": [ @@ -599,33 +652,51 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 71, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "We closed a total of 10 issues (enhancements and bug fixes) through 5 pull requests, since our last release on 2019-12-18.\n", + "We closed a total of 25 issues (enhancements and bug fixes) through 10 pull requests, since our last release on 2020-07-11.\n", "\n", "## Issues Closed\n", - " - Fixes for pandas deprecation and 3.8 verbosity (#101)\n", - " - ENH: adjust tests for new libpysal.examples (#98)\n", - " - update docs (#97)\n", - " - DOC: changelog update (#96)\n", - " - ENH: bumping version and handle array creation error in join counts (#95)\n", + " - fix concatenation for random statistics (#147)\n", + " - Dropping 3.6 from testing. (#152)\n", + " - Unexpected LISA results for polygons contained by another polygon (#153)\n", + " - CI: update conda setup (#151)\n", + " - Bump codecov/codecov-action from v1.0.14 to v1.0.15 (#150)\n", + " - Bump codecov/codecov-action from v1.0.13 to v1.0.14 (#149)\n", + " - Bump codecov/codecov-action from v1.0.12 to v1.0.13 (#144)\n", + " - Spatial cross-correlations? (#141)\n", + " - Bump codecov/codecov-action from v1.0.11 to v1.0.12 (#140)\n", + " - Bump codecov/codecov-action from v1.0.10 to v1.0.11 (#138)\n", + " - README.md missing from 2.3.0 on pypi (#136)\n", + " - [BUG] remove README.rst (#137)\n", + " - [DOC] Update for 2.30 (#135)\n", + " - Release notes for 2.3.0 (#127)\n", + " - (BUG) missing comma in setup.py (#134)\n", "\n", "## Pull Requests\n", - " - Fixes for pandas deprecation and 3.8 verbosity (#101)\n", - " - ENH: adjust tests for new libpysal.examples (#98)\n", - " - update docs (#97)\n", - " - DOC: changelog update (#96)\n", - " - ENH: bumping version and handle array creation error in join counts (#95)\n", + " - fix concatenation for random statistics (#147)\n", + " - Dropping 3.6 from testing. (#152)\n", + " - CI: update conda setup (#151)\n", + " - Bump codecov/codecov-action from v1.0.13 to v1.0.14 (#149)\n", + " - Bump codecov/codecov-action from v1.0.12 to v1.0.13 (#144)\n", + " - Bump codecov/codecov-action from v1.0.11 to v1.0.12 (#140)\n", + " - Bump codecov/codecov-action from v1.0.10 to v1.0.11 (#138)\n", + " - [BUG] remove README.rst (#137)\n", + " - [DOC] Update for 2.30 (#135)\n", + " - (BUG) missing comma in setup.py (#134)\n", "\n", "The following individuals contributed to this release:\n", "\n", " - Serge Rey\n", - " - Eli Knaap\n" + " - Martin Fleischmann\n", + " - James Gaboardi\n", + " - Dependabot[Bot]\n", + " - Levi John Wolf\n" ] } ], @@ -635,7 +706,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 72, "metadata": {}, "outputs": [], "source": [ @@ -644,7 +715,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 73, "metadata": {}, "outputs": [ { @@ -653,28 +724,46 @@ "text": [ "# Changes\n", "\n", - "Version 2.2.1 (2020-02-01)\n", + "Version 2.3.2 (2020-12-28)\n", "\n", - "We closed a total of 10 issues (enhancements and bug fixes) through 5 pull requests, since our last release on 2019-12-18.\n", + "We closed a total of 25 issues (enhancements and bug fixes) through 10 pull requests, since our last release on 2020-07-11.\n", "\n", "## Issues Closed\n", - " - Fixes for pandas deprecation and 3.8 verbosity (#101)\n", - " - ENH: adjust tests for new libpysal.examples (#98)\n", - " - update docs (#97)\n", - " - DOC: changelog update (#96)\n", - " - ENH: bumping version and handle array creation error in join counts (#95)\n", + " - fix concatenation for random statistics (#147)\n", + " - Dropping 3.6 from testing. (#152)\n", + " - Unexpected LISA results for polygons contained by another polygon (#153)\n", + " - CI: update conda setup (#151)\n", + " - Bump codecov/codecov-action from v1.0.14 to v1.0.15 (#150)\n", + " - Bump codecov/codecov-action from v1.0.13 to v1.0.14 (#149)\n", + " - Bump codecov/codecov-action from v1.0.12 to v1.0.13 (#144)\n", + " - Spatial cross-correlations? (#141)\n", + " - Bump codecov/codecov-action from v1.0.11 to v1.0.12 (#140)\n", + " - Bump codecov/codecov-action from v1.0.10 to v1.0.11 (#138)\n", + " - README.md missing from 2.3.0 on pypi (#136)\n", + " - [BUG] remove README.rst (#137)\n", + " - [DOC] Update for 2.30 (#135)\n", + " - Release notes for 2.3.0 (#127)\n", + " - (BUG) missing comma in setup.py (#134)\n", "\n", "## Pull Requests\n", - " - Fixes for pandas deprecation and 3.8 verbosity (#101)\n", - " - ENH: adjust tests for new libpysal.examples (#98)\n", - " - update docs (#97)\n", - " - DOC: changelog update (#96)\n", - " - ENH: bumping version and handle array creation error in join counts (#95)\n", + " - fix concatenation for random statistics (#147)\n", + " - Dropping 3.6 from testing. (#152)\n", + " - CI: update conda setup (#151)\n", + " - Bump codecov/codecov-action from v1.0.13 to v1.0.14 (#149)\n", + " - Bump codecov/codecov-action from v1.0.12 to v1.0.13 (#144)\n", + " - Bump codecov/codecov-action from v1.0.11 to v1.0.12 (#140)\n", + " - Bump codecov/codecov-action from v1.0.10 to v1.0.11 (#138)\n", + " - [BUG] remove README.rst (#137)\n", + " - [DOC] Update for 2.30 (#135)\n", + " - (BUG) missing comma in setup.py (#134)\n", "\n", "The following individuals contributed to this release:\n", "\n", " - Serge Rey\n", - " - Eli Knaap\n" + " - Martin Fleischmann\n", + " - James Gaboardi\n", + " - Dependabot[Bot]\n", + " - Levi John Wolf\n" ] } ], @@ -684,11 +773,11 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 74, "metadata": {}, "outputs": [], "source": [ - "outfile = 'changelog_{version}.md'.format(version=__version__)\n", + "outfile = 'changelog.md'\n", "with open(outfile, 'w') as of:\n", " of.write(head+message)" ] @@ -700,13 +789,6 @@ "outputs": [], "source": [] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "code", "execution_count": null, @@ -731,9 +813,16 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.1" + "version": "3.8.5" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } From ed5e074ab457eee17ee6bc66d0750f84a9fc4bba Mon Sep 17 00:00:00 2001 From: Serge Date: Tue, 29 Dec 2020 18:32:41 -0800 Subject: [PATCH 2/2] update pakcage name --- tools/gitcount.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gitcount.ipynb b/tools/gitcount.ipynb index ff40153e..ffe80a82 100644 --- a/tools/gitcount.ipynb +++ b/tools/gitcount.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## `tobler` Change Log Statistics\n", + "## `esda` Change Log Statistics\n", "\n", "This notebook generates the summary statistics for a package. \n", "\n",