diff --git a/Makefile b/Makefile index abd3cdd..3d8c442 100644 --- a/Makefile +++ b/Makefile @@ -78,10 +78,14 @@ update_docs: # Call like this: # make GITHUB_COM_TOKEN=$KEY TAGNAME=v2.23.0 release -release: export FILEBASE=git-filter-repo-$(shell echo $(TAGNAME) | tail -c +2) -release: export GIT_INDEX_FILE=$(shell mktemp) -release: export COMMIT=$(shell git rev-parse HEAD) -release: update_docs +release: github_release pypi_release + +# Call like this: +# make GITHUB_COM_TOKEN=$KEY TAGNAME=v2.23.0 github_release +github_release: export FILEBASE=git-filter-repo-$(shell echo $(TAGNAME) | tail -c +2) +github_release: export GIT_INDEX_FILE=$(shell mktemp) +github_release: export COMMIT=$(shell git rev-parse HEAD) +github_release: update_docs test -n "$(GITHUB_COM_TOKEN)" test -n "$(TAGNAME)" test -n "$$COMMIT" @@ -110,13 +114,21 @@ release: update_docs cat asset_id | xargs -I ASSET_ID curl -s -H "Authorization: token $(GITHUB_COM_TOKEN)" -H "Content-Type: application/octet-stream" --data-binary @$(FILEBASE).tar.xz https://uploads.github.com/repos/newren/git-filter-repo/releases/ASSET_ID/assets?name=$(FILEBASE).tar.xz # Remove temporary file(s) rm asset_id - # Upload to PyPI, automatically picking up the new tag - cd release && python3 setup.py sdist bdist_wheel - twine upload release/dist/* # Notify of completion @echo @echo === filter-repo $(TAGNAME) created and uploaded to GitHub === +pypi_release: # Has an implicit dependency on github_release because... + # Upload to PyPI, automatically picking tag created by github_release + cd release && python3 -m venv venv + cd release && venv/bin/pip3 install --upgrade setuptools pip + cd release && venv/bin/pip3 install twine wheel + cd release && venv/bin/python3 setup.py sdist bdist_wheel + cd release && venv/bin/twine upload dist/* + # Remove temporary file(s) + cd release && rm -f README.md git-filter-repo git_filter_repo.py + cd release && rm -rf .eggs/ build/ venv/ git_filter_repo.egg-info/ + # NOTE TO FUTURE SELF: If you accidentally push a bad release, you can remove # all but the git-filter-repo-$VERSION.tar.xz asset with # git push --delete origin $TAGNAME diff --git a/release/git-filter-repo b/release/git-filter-repo deleted file mode 120000 index ac3b52f..0000000 --- a/release/git-filter-repo +++ /dev/null @@ -1 +0,0 @@ -../git-filter-repo \ No newline at end of file diff --git a/release/git_filter_repo.py b/release/git_filter_repo.py deleted file mode 120000 index 451182e..0000000 --- a/release/git_filter_repo.py +++ /dev/null @@ -1 +0,0 @@ -../git_filter_repo.py \ No newline at end of file diff --git a/release/pyproject.toml b/release/pyproject.toml deleted file mode 100644 index 23bb041..0000000 --- a/release/pyproject.toml +++ /dev/null @@ -1,9 +0,0 @@ -[build-system] -requires = [ - # The minimum setuptools version is specific to the PEP 517 backend, - # and may be stricter than the version required in `setup.py` - "setuptools>=40.6.0", - "setuptools_scm", - "wheel", -] -build-backend = "setuptools.build_meta" diff --git a/release/setup.cfg b/release/setup.cfg index c6da423..078f3ff 100644 --- a/release/setup.cfg +++ b/release/setup.cfg @@ -6,6 +6,7 @@ project_urls = Issues = https://github.com/newren/git-filter-repo/issues/ description = Quickly rewrite git repository history long_description = file: README.md +long_description_content_type = text/markdown classifiers = Development Status :: 4 - Beta Operating System :: OS Independent @@ -18,6 +19,8 @@ classifiers = Programming Language :: Python :: 3 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy +platforms = any +license = MIT [options] scripts = git-filter-repo diff --git a/release/setup.py b/release/setup.py index 557aa07..ce60b2c 100644 --- a/release/setup.py +++ b/release/setup.py @@ -1,2 +1,5 @@ from setuptools import setup +import os +for f in ['git-filter-repo', 'git_filter_repo.py', 'README.md']: + os.symlink("../"+f, f) setup(use_scm_version=dict(root="..", relative_to=__file__))