From f8382b46853d676d97eb3a87ca539a8b93f7251d Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Wed, 5 Jun 2024 16:57:22 -0400 Subject: [PATCH 1/2] add shutdown logging, publish checklist --- README.md | 11 ++++++++--- webdiff/app.py | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 334742c..b2d01dd 100644 --- a/README.md +++ b/README.md @@ -129,12 +129,11 @@ To debug `git webdiff`, run: ./test-gitwebdiff.sh +## Publishing + To iterate on the PyPI package, run: - # from outside the webdiff virtualenv: pip3 uninstall webdiff - - # from inside the webdiff virtualenv, adjust for current version poetry build pip3 install dist/webdiff-?.?.?.tar.gz @@ -149,6 +148,12 @@ And to the real pypi: See [pypirc][] docs for details on setting up `~/.pypirc`. +Publication checklist. Do these from _outside_ the webdiff directory: + +- Run `webdiff webdiff/testdata/.../{left,right}` +- Run `git webdiff 52aa15f^..52aa15f` in the codediff.js repo +- Run `webdiff https://github.com/danvk/webdiff/pull/160` + ## Implementation notes webdiff doesn't calculate any diffs itself. Instead, it relies on `git diff`. This is possible because `git diff` has a `--no-index` mode that allows it to operate outside of a git repository. Of course, this means that you need to have `git` installed to use webdiff! diff --git a/webdiff/app.py b/webdiff/app.py index 3b09d06..793a9a9 100755 --- a/webdiff/app.py +++ b/webdiff/app.py @@ -225,6 +225,7 @@ def shutdown(): if LAST_REQUEST_MS <= last_ms: # subsequent requests abort shutdown # See https://stackoverflow.com/a/19040484/388951 # and https://stackoverflow.com/q/4330111/388951 + sys.stderr.write('Shutting down...\n') threading.Thread(target=self.server.shutdown, daemon=True).start() else: logging.debug('Received subsequent request; canceling shutdown') From 4793a2d7d28203bed58d7f32fbf59040405852f7 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Wed, 5 Jun 2024 17:03:46 -0400 Subject: [PATCH 2/2] testpypi publish --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b2d01dd..569d1ba 100644 --- a/README.md +++ b/README.md @@ -140,13 +140,13 @@ To iterate on the PyPI package, run: To publish to pypitest: poetry build - ??? + poetry publish -r testpypi And to the real pypi: poetry publish -See [pypirc][] docs for details on setting up `~/.pypirc`. +See [pypirc][] and [poetry][] docs for details on setting up tokens for pypi. Publication checklist. Do these from _outside_ the webdiff directory: @@ -181,3 +181,4 @@ There's one complication involving symlinks. `git difftool -d` may fill one of t [ImageMagick]: https://imagemagick.org/index.php [git config]: https://git-scm.com/docs/git-config [themes]: http://example.com +[poetry]: https://python-poetry.org/docs/repositories/#publishable-repositories