From cb5bbc77c1e426aba910b5d9ed9349293bdf8479 Mon Sep 17 00:00:00 2001 From: eli knaap Date: Mon, 11 Sep 2023 10:33:38 -0700 Subject: [PATCH 1/2] migrate to pyproject --- .coveragerc | 30 - .github/release.yml | 16 + .github/workflows/release_and_publish.yml | 34 +- CHANGELOG.txt | 1 - MANIFEST.in | 1 - codecov.yml | 22 + environment.yml | 10 + pyproject.toml | 104 +++ readthedocs.yml | 18 - requirements.txt | 5 - requirements_tests.txt | 6 - setup.py | 77 -- tools/gitcount.ipynb | 880 ---------------------- 13 files changed, 174 insertions(+), 1030 deletions(-) delete mode 100644 .coveragerc create mode 100644 .github/release.yml delete mode 100644 CHANGELOG.txt delete mode 100644 MANIFEST.in create mode 100644 codecov.yml create mode 100644 environment.yml create mode 100644 pyproject.toml delete mode 100644 readthedocs.yml delete mode 100644 requirements.txt delete mode 100644 requirements_tests.txt delete mode 100644 setup.py delete mode 100644 tools/gitcount.ipynb diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 91f3800..0000000 --- a/.coveragerc +++ /dev/null @@ -1,30 +0,0 @@ -# .coveragerc to control coverage.py -[run] -branch = True -source = pointpats - -[report] -# Regexes for lines to exclude from consideration -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - - # Don't complain about missing debug-only code: - def __repr__ - if self\.debug - - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - - # Don't complain if non-runnable code isn't run: - if 0: - if __name__ == .__main__.: - -ignore_errors = True -omit = - */tests/* - *__init__.py - -[html] -directory = coverage_html_report diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..3a0052d --- /dev/null +++ b/.github/release.yml @@ -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: + - "*" \ No newline at end of file diff --git a/.github/workflows/release_and_publish.yml b/.github/workflows/release_and_publish.yml index ecc932b..5e3a752 100644 --- a/.github/workflows/release_and_publish.yml +++ b/.github/workflows/release_and_publish.yml @@ -1,16 +1,15 @@ # Release package on GitHub and publish to PyPI # IMPORTANT -- 1 MANUAL STEP # * FOLLOWING TAGGED RELEASE -# - update CHANGELOG.md +# - update CHANGELOG.md #-------------------------------------------------- - -name: Build, Release, and publish +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 + - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 workflow_dispatch: inputs: version: @@ -24,21 +23,32 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v3 - + uses: actions/checkout@v4 + - name: Set up python uses: actions/setup-python@v4 with: python-version: "3.x" - - - name: Install dependencies + + - 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 - + python -m pip install --upgrade build twine + python -m build + twine check --strict dist/* + + - 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 }} + password: ${{ secrets.PYPI_PASSWORD }} \ No newline at end of file diff --git a/CHANGELOG.txt b/CHANGELOG.txt deleted file mode 100644 index 4942ccb..0000000 --- a/CHANGELOG.txt +++ /dev/null @@ -1 +0,0 @@ -Changelog is at https://github.com/pysal/pointpats/releases diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 09db3ec..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include LICENSE.txt CHANGELOG.txt MANIFEST.in requirements_docs.txt requirements_tests.txt requirements.txt \ No newline at end of file diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..1c35385 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,22 @@ +codecov: + notify: + after_n_builds: 7 +coverage: + range: 50..95 + round: nearest + precision: 1 + status: + project: + default: + threshold: 5% + patch: + default: + threshold: 20% + target: 60% + ignore: + - "tests/*" +comment: + layout: "reach, diff, files" + behavior: once + after_n_builds: 7 + require_changes: true \ No newline at end of file diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..933fc35 --- /dev/null +++ b/environment.yml @@ -0,0 +1,10 @@ +name: pointpats +channels: + - conda-forge + - defaults +dependencies: + - pandas + - libpysal + - matplotlib + - pandas + - scipy>=0.11 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b37ec5e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,104 @@ +[build-system] +requires = ["setuptools>=61.0", "setuptools_scm[toml]>=6.2"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] + +[project] +name = "pointpats" +dynamic = ["version"] +authors = [ + { name = "Serge Rey", email = "sjsrey@gmail.com" }, + { name = "Hu Shao", email = "shaohutiger@gmail.com" }, +] +maintainers = [{ name = "pysal contributors" }] +license = { text = "BSD 3-Clause" } +description = "Methods and Functions for planar point pattern analysis" +keywords = [ + "spatial statistics, point patterns" +] +readme = { text = """\ +"Methods and Functions for planar point pattern analysis" + +""", content-type = "text/x-rst" } +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: GIS", +] +requires-python = ">=3.7" +dependencies = [ + "numpy", + "pandas", + "scipy >=1.8", + "libpysal >=4", + "matplotlib" +] + +[project.urls] +Home = "https://github.com/pysal/pointpats/" +Repository = "https://github.com/pysal/pointpats" + +[project.optional-dependencies] +dev = ["pre-commit"] +docs = [ + "nbsphinx", + "numpydoc", + "pandoc", + "sphinx", + "sphinxcontrib-bibtex", + "sphinx_bootstrap_theme", + "mkdocs-jupyter", + "myst-parser" +] +tests = [ + "geopandas", + "codecov", + "coverage", + "pytest", + "pytest-mpl", + "pytest-cov", + "watermark", +] + +[tool.setuptools.packages.find] +include = ["pointpats", "pointpats.*"] + +[tool.black] +line-length = 88 + +[tool.ruff] +line-length = 88 +select = ["E", "F", "W", "I", "UP", "N", "B", "A", "C4", "SIM", "ARG"] +target-version = "py39" +ignore = [ + "B006", + "B008", + "B009", + "B010", + "C408", + "E731", + "F401", + "F403", + "N803", + "N806", + "N999", + "UP007" +] +exclude = ["pointpats/tests/*", "docs/*"] + +[tool.coverage.run] +source = ["./pointpats"] + +[tool.coverage.report] +exclude_lines = [ + "if self.debug:", + "pragma: no cover", + "raise NotImplementedError", + "except ModuleNotFoundError:", + "except ImportError", +] +ignore_errors = true +omit = ["pointpats/tests/*", "docs/conf.py"] diff --git a/readthedocs.yml b/readthedocs.yml deleted file mode 100644 index 0ad3662..0000000 --- a/readthedocs.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Required -version: 2 - -# Build documentation in the docs/ directory with Sphinx -sphinx: - configuration: doc/conf.py - -# Optionally build your docs in additional formats such as PDF and ePub -formats: all - -python: - version: 3.7 - install: - - requirements: requirements.txt - - method: pip - path: . - extra_requirements: - - docs diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index bc611a6..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -scipy>=1.8.0 -numpy>=1.3 -pandas -matplotlib -libpysal>=4.0.0 diff --git a/requirements_tests.txt b/requirements_tests.txt deleted file mode 100644 index ec62e8b..0000000 --- a/requirements_tests.txt +++ /dev/null @@ -1,6 +0,0 @@ -scikit-learn -shapely -geopandas -pytest -codecov -pytest-cov diff --git a/setup.py b/setup.py deleted file mode 100644 index 6cb75b8..0000000 --- a/setup.py +++ /dev/null @@ -1,77 +0,0 @@ -from setuptools import setup, find_packages -import os -from distutils.command.build_py import build_py - -# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly -# update it when the contents of directories change. -if os.path.exists("MANIFEST"): - os.remove("MANIFEST") - -# Get __version__ from PACKAGE_NAME/__init__.py without importing the package -# __version__ has to be defined in the first line -with open("pointpats/__init__.py", "r") as f: - exec(f.readline()) - -with open("README.md", "r", encoding="utf8") as file: - long_description = file.read() - - -def _get_requirements_from_files(groups_files): - groups_reqlist = {} - - for k, v in groups_files.items(): - with open(v, "r") as f: - pkg_list = f.read().splitlines() - groups_reqlist[k] = pkg_list - - return groups_reqlist - - -def setup_package(): - _groups_files = { - "base": "requirements.txt", # basic requirements - "tests": "requirements_tests.txt", # requirements for tests - "docs": "requirements_docs.txt", # requirements for building docs - } - reqs = _get_requirements_from_files(_groups_files) - install_reqs = reqs.pop("base") - extras_reqs = reqs - - setup( - name="pointpats", - version=__version__, - description="Methods and Functions for planar point pattern analysis", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/pysal/pointpats", - maintainer="Hu Shao", - maintainer_email="shaohutiger@gmail.com", - py_modules=["pointpats"], - python_requires=">3.7", - tests_require=["pytest"], - keywords="spatial statistics", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Science/Research", - "Intended Audience :: Developers", - "Intended Audience :: Education", - "Topic :: Scientific/Engineering", - "Topic :: Scientific/Engineering :: GIS", - "License :: OSI Approved :: BSD License", - "Programming Language :: Python", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11" - ], - license="3-Clause BSD", - packages=find_packages(), - install_requires=install_reqs, - extras_require=extras_reqs, - zip_safe=False, - cmdclass={"build.py": build_py}, - ) - - -if __name__ == "__main__": - setup_package() diff --git a/tools/gitcount.ipynb b/tools/gitcount.ipynb deleted file mode 100644 index ea8ec1f..0000000 --- a/tools/gitcount.ipynb +++ /dev/null @@ -1,880 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## PySAL Change Log Statistics\n", - "\n", - "This notebook generates the summary statistics for a package. \n", - "\n", - "It assumes you are running this under the `tools` directory at the toplevel of the package\n", - "\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Change the values only in the next cell" - ] - }, - { - "cell_type": "code", - "execution_count": 35, - "metadata": {}, - "outputs": [], - "source": [ - "package_name = 'pointpats'\n", - "release_date = '2023-03-07'\n", - "start_date = '2020-07-27'" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This notebook will generate a file in the current directory with the name \"changelog_VERSION.md\". You can edit and append this on front of the CHANGELOG file for the package release." - ] - }, - { - "cell_type": "code", - "execution_count": 36, - "metadata": {}, - "outputs": [], - "source": [ - "from __future__ import print_function\n", - "import os\n", - "import json\n", - "import re\n", - "import sys\n", - "import pandas\n", - "\n", - "from datetime import datetime, timedelta\n", - "from time import sleep\n", - "from subprocess import check_output\n", - "try:\n", - " from urllib import urlopen\n", - "except:\n", - " from urllib.request import urlopen\n", - "\n", - "import ssl\n", - "import yaml\n", - "\n", - "context = ssl._create_unverified_context()\n" - ] - }, - { - "cell_type": "code", - "execution_count": 37, - "metadata": {}, - "outputs": [], - "source": [ - "CWD = os.path.abspath(os.path.curdir)" - ] - }, - { - "cell_type": "code", - "execution_count": 38, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'/Users/wk0110/My Drive (weikang9009@gmail.com)/python_repos/pysal-refactor/pointpats/tools'" - ] - }, - "execution_count": 38, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "CWD" - ] - }, - { - "cell_type": "code", - "execution_count": 39, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "datetime.datetime(2020, 7, 27, 0, 0)" - ] - }, - "execution_count": 39, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "since_date = '--since=\"{start}\"'.format(start=start_date)\n", - "since_date\n", - "since = datetime.strptime(start_date+\" 0:0:0\", \"%Y-%m-%d %H:%M:%S\")\n", - "since" - ] - }, - { - "cell_type": "code", - "execution_count": 40, - "metadata": {}, - "outputs": [], - "source": [ - "# get __version__\n", - "f = \"../{package}/__init__.py\".format(package=package_name)\n", - "\n", - "with open(f, 'r') as initfile:\n", - " exec(initfile.readline())\n", - " " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Total commits by subpackage" - ] - }, - { - "cell_type": "code", - "execution_count": 41, - "metadata": {}, - "outputs": [], - "source": [ - "cmd = ['git', 'log', '--oneline', since_date]\n", - "ncommits = len(check_output(cmd).splitlines())" - ] - }, - { - "cell_type": "code", - "execution_count": 42, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "34" - ] - }, - "execution_count": 42, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ncommits" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## List Contributors" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Some of our contributors have many aliases for the same identity. So, we've added a mapping to make sure that individuals are listed once (and only once). " - ] - }, - { - "cell_type": "code", - "execution_count": 43, - "metadata": {}, - "outputs": [], - "source": [ - "identities = {'Levi John Wolf': ('ljwolf', 'Levi John Wolf'),\n", - " 'Serge Rey': ('Serge Rey', 'Sergio Rey', 'sjsrey', 'serge'),\n", - " 'Wei Kang': ('Wei Kang', 'weikang9009'),\n", - " 'Dani Arribas-Bel': ('Dani Arribas-Bel', 'darribas')\n", - "}\n", - "\n", - "def regularize_identity(string):\n", - " string = string.decode()\n", - " for name, aliases in identities.items():\n", - " for alias in aliases:\n", - " if alias in string:\n", - " string = string.replace(alias, name)\n", - " if len(string.split(' '))>1:\n", - " string = string.title()\n", - " return string.lstrip('* ')" - ] - }, - { - "cell_type": "code", - "execution_count": 44, - "metadata": {}, - "outputs": [], - "source": [ - "author_cmd = ['git', 'log', '--format=* %aN', since_date]" - ] - }, - { - "cell_type": "code", - "execution_count": 45, - "metadata": {}, - "outputs": [], - "source": [ - "from collections import Counter" - ] - }, - { - "cell_type": "code", - "execution_count": 46, - "metadata": {}, - "outputs": [], - "source": [ - "\n", - "ncommits = len(check_output(cmd).splitlines())\n", - "all_authors = check_output(author_cmd).splitlines()\n", - "counter = Counter([regularize_identity(author) for author in all_authors])\n", - "# global_counter += counter\n", - "# counters.update({'.'.join((package,subpackage)): counter})\n", - "unique_authors = sorted(set(all_authors))\n" - ] - }, - { - "cell_type": "code", - "execution_count": 47, - "metadata": {}, - "outputs": [], - "source": [ - "unique_authors = counter.keys()" - ] - }, - { - "cell_type": "code", - "execution_count": 48, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "dict_keys(['Wei Kang', 'Levi John Wolf', 'James Gaboardi', 'Serge Rey', 'Martin Fleischmann', 'Qiusheng Wu', 'Giovp'])" - ] - }, - "execution_count": 48, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "unique_authors" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Disaggregate by PR, Issue" - ] - }, - { - "cell_type": "code", - "execution_count": 49, - "metadata": {}, - "outputs": [], - "source": [ - "from datetime import datetime, timedelta\n", - "ISO8601 = \"%Y-%m-%dT%H:%M:%SZ\"\n", - "PER_PAGE = 100\n", - "element_pat = re.compile(r'<(.+?)>')\n", - "rel_pat = re.compile(r'rel=[\\'\"](\\w+)[\\'\"]')\n" - ] - }, - { - "cell_type": "code", - "execution_count": 50, - "metadata": {}, - "outputs": [], - "source": [ - "\n", - "def parse_link_header(headers):\n", - " link_s = headers.get('link', '')\n", - " urls = element_pat.findall(link_s)\n", - " rels = rel_pat.findall(link_s)\n", - " d = {}\n", - " for rel,url in zip(rels, urls):\n", - " d[rel] = url\n", - " return d\n", - "\n", - "def get_paged_request(url):\n", - " \"\"\"get a full list, handling APIv3's paging\"\"\"\n", - " results = []\n", - " while url:\n", - " #print(\"fetching %s\" % url, file=sys.stderr)\n", - " f = urlopen(url)\n", - " results.extend(json.load(f))\n", - " links = parse_link_header(f.headers)\n", - " url = links.get('next')\n", - " return results\n", - "\n", - "def get_issues(project=\"pysal/giddy\", state=\"closed\", pulls=False):\n", - " \"\"\"Get a list of the issues from the Github API.\"\"\"\n", - " which = 'pulls' if pulls else 'issues'\n", - " url = \"https://api.github.com/repos/%s/%s?state=%s&per_page=%i\" % (project, which, state, PER_PAGE)\n", - " return get_paged_request(url)\n", - "\n", - "\n", - "def _parse_datetime(s):\n", - " \"\"\"Parse dates in the format returned by the Github API.\"\"\"\n", - " if s:\n", - " return datetime.strptime(s, ISO8601)\n", - " else:\n", - " return datetime.fromtimestamp(0)\n", - "\n", - "\n", - "def issues2dict(issues):\n", - " \"\"\"Convert a list of issues to a dict, keyed by issue number.\"\"\"\n", - " idict = {}\n", - " for i in issues:\n", - " idict[i['number']] = i\n", - " return idict\n", - "\n", - "\n", - "def is_pull_request(issue):\n", - " \"\"\"Return True if the given issue is a pull request.\"\"\"\n", - " return 'pull_request_url' in issue\n", - "\n", - "\n", - "def issues_closed_since(period=timedelta(days=365), project=\"pysal/pysal\", pulls=False):\n", - " \"\"\"Get all issues closed since a particular point in time. period\n", - "can either be a datetime object, or a timedelta object. In the\n", - "latter case, it is used as a time before the present.\"\"\"\n", - "\n", - " which = 'pulls' if pulls else 'issues'\n", - "\n", - " if isinstance(period, timedelta):\n", - " period = datetime.now() - period\n", - " url = \"https://api.github.com/repos/%s/%s?state=closed&sort=updated&since=%s&per_page=%i\" % (project, which, period.strftime(ISO8601), PER_PAGE)\n", - " allclosed = get_paged_request(url)\n", - " # allclosed = get_issues(project=project, state='closed', pulls=pulls, since=period)\n", - " filtered = [i for i in allclosed if _parse_datetime(i['closed_at']) > period]\n", - "\n", - " # exclude rejected PRs\n", - " if pulls:\n", - " filtered = [ pr for pr in filtered if pr['merged_at'] ]\n", - "\n", - " return filtered\n", - "\n", - "\n", - "def sorted_by_field(issues, field='closed_at', reverse=False):\n", - " \"\"\"Return a list of issues sorted by closing date date.\"\"\"\n", - " return sorted(issues, key = lambda i:i[field], reverse=reverse)\n", - "\n", - "\n", - "def report(issues, show_urls=False):\n", - " \"\"\"Summary report about a list of issues, printing number and title.\n", - " \"\"\"\n", - " # titles may have unicode in them, so we must encode everything below\n", - " if show_urls:\n", - " for i in issues:\n", - " role = 'ghpull' if 'merged_at' in i else 'ghissue'\n", - " print('* :%s:`%d`: %s' % (role, i['number'],\n", - " i['title'].encode('utf-8')))\n", - " else:\n", - " for i in issues:\n", - " print('* %d: %s' % (i['number'], i['title'].encode('utf-8')))\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": 51, - "metadata": {}, - "outputs": [], - "source": [ - "\n", - "all_issues = {}\n", - "all_pulls = {}\n", - "total_commits = 0\n", - "#prj='pysal/libpysal'\n", - "prj = 'pysal/{package}'.format(package=package_name)\n", - "issues = issues_closed_since(since, project=prj,pulls=False)\n", - "pulls = issues_closed_since(since, project=prj,pulls=True)\n", - "issues = sorted_by_field(issues, reverse=True)\n", - "pulls = sorted_by_field(pulls, reverse=True)\n", - "n_issues, n_pulls = map(len, (issues, pulls))\n", - "n_total = n_issues + n_pulls\n" - ] - }, - { - "cell_type": "code", - "execution_count": 52, - "metadata": {}, - "outputs": [], - "source": [ - "issue_listing = []\n", - "for issue in issues:\n", - " entry = \"{title} (#{number})\".format(title=issue['title'],number=issue['number'])\n", - " issue_listing.append(entry)" - ] - }, - { - "cell_type": "code", - "execution_count": 53, - "metadata": {}, - "outputs": [], - "source": [ - "pull_listing = []\n", - "for pull in pulls:\n", - " entry = \"{title} (#{number})\".format(title=pull['title'],number=pull['number'])\n", - " pull_listing.append(entry)" - ] - }, - { - "cell_type": "code", - "execution_count": 54, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['Fix github action for docs building (#97)',\n", - " 'add packages for building docs in env file (#96)',\n", - " 'Docs (#95)',\n", - " 'bump to v2.3.0 (#94)',\n", - " 'migrate docs from RTD to github page (#92)',\n", - " 'add github action for release and doc building (#90)',\n", - " 'handle scipy deprecation (#91)',\n", - " '[WIP] Migrate to GitHub Actions for testing (#64)',\n", - " 'update centrography test for dep induced precision breakage (#69)',\n", - " 'GHA: fix target (#88)',\n", - " 'Set up and update infrastructure (#87)',\n", - " 'Make opencv package optional (#82)',\n", - " 'DOC: fix API docs (#85)',\n", - " 'remove extra material from ripley.py and source from geometry.py (#74)',\n", - " 'handle 0-index simplex in delaunay (#73)',\n", - " 'Remove rst file and update setup.py (#61)',\n", - " '[ENH] Version bump for 2.2 and pointer to changelog (#59)']" - ] - }, - "execution_count": 54, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "pull_listing" - ] - }, - { - "cell_type": "code", - "execution_count": 55, - "metadata": {}, - "outputs": [], - "source": [ - "message = \"We closed a total of {total} issues (enhancements and bug fixes) through {pr} pull requests\".format(total=n_total, pr=n_pulls)" - ] - }, - { - "cell_type": "code", - "execution_count": 56, - "metadata": {}, - "outputs": [], - "source": [ - "message = \"{msg}, since our last release on {previous}.\".format(msg=message, previous=str(start_date))\n" - ] - }, - { - "cell_type": "code", - "execution_count": 57, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'We closed a total of 48 issues (enhancements and bug fixes) through 17 pull requests, since our last release on 2020-07-27.'" - ] - }, - "execution_count": 57, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "message" - ] - }, - { - "cell_type": "code", - "execution_count": 58, - "metadata": {}, - "outputs": [], - "source": [ - "message += \"\\n\\n## Issues Closed\\n\"" - ] - }, - { - "cell_type": "code", - "execution_count": 59, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "We closed a total of 48 issues (enhancements and bug fixes) through 17 pull requests, since our last release on 2020-07-27.\n", - "\n", - "## Issues Closed\n", - "\n" - ] - } - ], - "source": [ - "print(message)" - ] - }, - { - "cell_type": "code", - "execution_count": 60, - "metadata": {}, - "outputs": [], - "source": [ - "issues = \"\\n\".join([\" - \"+issue for issue in issue_listing])\n", - "message += issues\n", - "message += \"\\n\\n## Pull Requests\\n\"\n", - "pulls = \"\\n\".join([\" - \"+pull for pull in pull_listing])\n", - "message += pulls" - ] - }, - { - "cell_type": "code", - "execution_count": 61, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "We closed a total of 48 issues (enhancements and bug fixes) through 17 pull requests, since our last release on 2020-07-27.\n", - "\n", - "## Issues Closed\n", - " - Update docs for 2.2.0 (#62)\n", - " - Infrastructure (#86)\n", - " - Fix github action for docs building (#97)\n", - " - add packages for building docs in env file (#96)\n", - " - Docs (#95)\n", - " - bump to v2.3.0 (#94)\n", - " - migrate docs from RTD to github page (#92)\n", - " - add github action for release and doc building (#90)\n", - " - handle scipy deprecation (#91)\n", - " - [WIP] Migrate to GitHub Actions for testing (#64)\n", - " - pointpats on conda-forge fails pip check (#80)\n", - " - Documentation for `pointpats` version 2.2.0 in Google Colab (#76)\n", - " - Move testing to github actions (#63)\n", - " - Deprecated statistics included in the manual (#79)\n", - " - update centrography test for dep induced precision breakage (#69)\n", - " - GHA: fix target (#88)\n", - " - Set up and update infrastructure (#87)\n", - " - Make opencv package optional (#82)\n", - " - pointpats.random not in the API docs (#84)\n", - " - DOC: fix API docs (#85)\n", - " - Cannot import name 'G' from 'pointpats' (/usr/local/lib/python3.7/dist-packages/pointpats/__init__.py) (#78)\n", - " - remove extra material from ripley.py and source from geometry.py (#74)\n", - " - L or other distance modules are not recognized (#65)\n", - " - Simulation Envelopes, Low & High (#57)\n", - " - Jenv binsize correction is incorrect. (#51)\n", - " - Kenv is very memory inefficient (#52)\n", - " - handle 0-index simplex in delaunay (#73)\n", - " - poisson point process with delaunay missing first triangle (#72)\n", - " - Remove rst file and update setup.py (#61)\n", - " - add pypi maintainer (#60)\n", - " - [ENH] Version bump for 2.2 and pointer to changelog (#59)\n", - "\n", - "## Pull Requests\n", - " - Fix github action for docs building (#97)\n", - " - add packages for building docs in env file (#96)\n", - " - Docs (#95)\n", - " - bump to v2.3.0 (#94)\n", - " - migrate docs from RTD to github page (#92)\n", - " - add github action for release and doc building (#90)\n", - " - handle scipy deprecation (#91)\n", - " - [WIP] Migrate to GitHub Actions for testing (#64)\n", - " - update centrography test for dep induced precision breakage (#69)\n", - " - GHA: fix target (#88)\n", - " - Set up and update infrastructure (#87)\n", - " - Make opencv package optional (#82)\n", - " - DOC: fix API docs (#85)\n", - " - remove extra material from ripley.py and source from geometry.py (#74)\n", - " - handle 0-index simplex in delaunay (#73)\n", - " - Remove rst file and update setup.py (#61)\n", - " - [ENH] Version bump for 2.2 and pointer to changelog (#59)\n" - ] - } - ], - "source": [ - "print(message)" - ] - }, - { - "cell_type": "code", - "execution_count": 62, - "metadata": {}, - "outputs": [], - "source": [ - "people = \"\\n\".join([\" - \"+person for person in unique_authors])" - ] - }, - { - "cell_type": "code", - "execution_count": 63, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " - Wei Kang\n", - " - Levi John Wolf\n", - " - James Gaboardi\n", - " - Serge Rey\n", - " - Martin Fleischmann\n", - " - Qiusheng Wu\n", - " - Giovp\n" - ] - } - ], - "source": [ - "print(people)" - ] - }, - { - "cell_type": "code", - "execution_count": 64, - "metadata": {}, - "outputs": [], - "source": [ - "message +=\"\\n\\nThe following individuals contributed to this release:\\n\\n{people}\".format(people=people)" - ] - }, - { - "cell_type": "code", - "execution_count": 65, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "We closed a total of 48 issues (enhancements and bug fixes) through 17 pull requests, since our last release on 2020-07-27.\n", - "\n", - "## Issues Closed\n", - " - Update docs for 2.2.0 (#62)\n", - " - Infrastructure (#86)\n", - " - Fix github action for docs building (#97)\n", - " - add packages for building docs in env file (#96)\n", - " - Docs (#95)\n", - " - bump to v2.3.0 (#94)\n", - " - migrate docs from RTD to github page (#92)\n", - " - add github action for release and doc building (#90)\n", - " - handle scipy deprecation (#91)\n", - " - [WIP] Migrate to GitHub Actions for testing (#64)\n", - " - pointpats on conda-forge fails pip check (#80)\n", - " - Documentation for `pointpats` version 2.2.0 in Google Colab (#76)\n", - " - Move testing to github actions (#63)\n", - " - Deprecated statistics included in the manual (#79)\n", - " - update centrography test for dep induced precision breakage (#69)\n", - " - GHA: fix target (#88)\n", - " - Set up and update infrastructure (#87)\n", - " - Make opencv package optional (#82)\n", - " - pointpats.random not in the API docs (#84)\n", - " - DOC: fix API docs (#85)\n", - " - Cannot import name 'G' from 'pointpats' (/usr/local/lib/python3.7/dist-packages/pointpats/__init__.py) (#78)\n", - " - remove extra material from ripley.py and source from geometry.py (#74)\n", - " - L or other distance modules are not recognized (#65)\n", - " - Simulation Envelopes, Low & High (#57)\n", - " - Jenv binsize correction is incorrect. (#51)\n", - " - Kenv is very memory inefficient (#52)\n", - " - handle 0-index simplex in delaunay (#73)\n", - " - poisson point process with delaunay missing first triangle (#72)\n", - " - Remove rst file and update setup.py (#61)\n", - " - add pypi maintainer (#60)\n", - " - [ENH] Version bump for 2.2 and pointer to changelog (#59)\n", - "\n", - "## Pull Requests\n", - " - Fix github action for docs building (#97)\n", - " - add packages for building docs in env file (#96)\n", - " - Docs (#95)\n", - " - bump to v2.3.0 (#94)\n", - " - migrate docs from RTD to github page (#92)\n", - " - add github action for release and doc building (#90)\n", - " - handle scipy deprecation (#91)\n", - " - [WIP] Migrate to GitHub Actions for testing (#64)\n", - " - update centrography test for dep induced precision breakage (#69)\n", - " - GHA: fix target (#88)\n", - " - Set up and update infrastructure (#87)\n", - " - Make opencv package optional (#82)\n", - " - DOC: fix API docs (#85)\n", - " - remove extra material from ripley.py and source from geometry.py (#74)\n", - " - handle 0-index simplex in delaunay (#73)\n", - " - Remove rst file and update setup.py (#61)\n", - " - [ENH] Version bump for 2.2 and pointer to changelog (#59)\n", - "\n", - "The following individuals contributed to this release:\n", - "\n", - " - Wei Kang\n", - " - Levi John Wolf\n", - " - James Gaboardi\n", - " - Serge Rey\n", - " - Martin Fleischmann\n", - " - Qiusheng Wu\n", - " - Giovp\n" - ] - } - ], - "source": [ - "print(message)" - ] - }, - { - "cell_type": "code", - "execution_count": 66, - "metadata": {}, - "outputs": [], - "source": [ - "head = \"# Changes\\n\\nVersion {version} ({release_date})\\n\\n\".format(version=__version__, release_date=release_date)" - ] - }, - { - "cell_type": "code", - "execution_count": 67, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "# Changes\n", - "\n", - "Version 2.3.0 (2023-03-07)\n", - "\n", - "We closed a total of 48 issues (enhancements and bug fixes) through 17 pull requests, since our last release on 2020-07-27.\n", - "\n", - "## Issues Closed\n", - " - Update docs for 2.2.0 (#62)\n", - " - Infrastructure (#86)\n", - " - Fix github action for docs building (#97)\n", - " - add packages for building docs in env file (#96)\n", - " - Docs (#95)\n", - " - bump to v2.3.0 (#94)\n", - " - migrate docs from RTD to github page (#92)\n", - " - add github action for release and doc building (#90)\n", - " - handle scipy deprecation (#91)\n", - " - [WIP] Migrate to GitHub Actions for testing (#64)\n", - " - pointpats on conda-forge fails pip check (#80)\n", - " - Documentation for `pointpats` version 2.2.0 in Google Colab (#76)\n", - " - Move testing to github actions (#63)\n", - " - Deprecated statistics included in the manual (#79)\n", - " - update centrography test for dep induced precision breakage (#69)\n", - " - GHA: fix target (#88)\n", - " - Set up and update infrastructure (#87)\n", - " - Make opencv package optional (#82)\n", - " - pointpats.random not in the API docs (#84)\n", - " - DOC: fix API docs (#85)\n", - " - Cannot import name 'G' from 'pointpats' (/usr/local/lib/python3.7/dist-packages/pointpats/__init__.py) (#78)\n", - " - remove extra material from ripley.py and source from geometry.py (#74)\n", - " - L or other distance modules are not recognized (#65)\n", - " - Simulation Envelopes, Low & High (#57)\n", - " - Jenv binsize correction is incorrect. (#51)\n", - " - Kenv is very memory inefficient (#52)\n", - " - handle 0-index simplex in delaunay (#73)\n", - " - poisson point process with delaunay missing first triangle (#72)\n", - " - Remove rst file and update setup.py (#61)\n", - " - add pypi maintainer (#60)\n", - " - [ENH] Version bump for 2.2 and pointer to changelog (#59)\n", - "\n", - "## Pull Requests\n", - " - Fix github action for docs building (#97)\n", - " - add packages for building docs in env file (#96)\n", - " - Docs (#95)\n", - " - bump to v2.3.0 (#94)\n", - " - migrate docs from RTD to github page (#92)\n", - " - add github action for release and doc building (#90)\n", - " - handle scipy deprecation (#91)\n", - " - [WIP] Migrate to GitHub Actions for testing (#64)\n", - " - update centrography test for dep induced precision breakage (#69)\n", - " - GHA: fix target (#88)\n", - " - Set up and update infrastructure (#87)\n", - " - Make opencv package optional (#82)\n", - " - DOC: fix API docs (#85)\n", - " - remove extra material from ripley.py and source from geometry.py (#74)\n", - " - handle 0-index simplex in delaunay (#73)\n", - " - Remove rst file and update setup.py (#61)\n", - " - [ENH] Version bump for 2.2 and pointer to changelog (#59)\n", - "\n", - "The following individuals contributed to this release:\n", - "\n", - " - Wei Kang\n", - " - Levi John Wolf\n", - " - James Gaboardi\n", - " - Serge Rey\n", - " - Martin Fleischmann\n", - " - Qiusheng Wu\n", - " - Giovp\n" - ] - } - ], - "source": [ - "print(head+message)" - ] - }, - { - "cell_type": "code", - "execution_count": 68, - "metadata": {}, - "outputs": [], - "source": [ - "outfile = 'changelog_{version}.md'.format(version=__version__)\n", - "with open(outfile, 'w') as of:\n", - " of.write(head+message)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.13" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From fd0ba6c6668f469097e622aa0ba222d6321ab8be Mon Sep 17 00:00:00 2001 From: eli knaap Date: Tue, 12 Sep 2023 14:37:51 -0700 Subject: [PATCH 2/2] install before make docs --- .github/workflows/build_docs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index df1d25a..0f3b248 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -45,7 +45,9 @@ micromamba-version: 'latest' - name: make docs - run: cd docs; make html + run: | + pip install -e . --no-deps --force-reinstall + cd docs; make html - name: commit docs run: |