From fb7df1165bb5f44263f3e9202079e329d521dd0c Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Fri, 24 Nov 2023 21:57:06 +0000 Subject: [PATCH 1/4] remove MANIFEST.in which wasn't effective anyway --- MANIFEST.in | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index cc0231cf..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -exclude trtools/testsupport/sample_vcfs -exclude trtools/testsupport/sample_regions -exclude trtools/testsupport/sample_stats -include LICENSE.txt - From 4802488ce164447e91e5cc41783ee0d2d1d86e68 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Fri, 24 Nov 2023 21:58:37 +0000 Subject: [PATCH 2/4] implement new versioning scheme The pyproject.toml file is now the single location for the version to be declared. It will be read by __init__.py automatically. The old system used setuptools-scm but apparently that has the unintended side-effect of adding all files tracked by version control to the sdist! yikes Refer to https://github.com/pypa/setuptools_scm/issues/190 for more details --- .readthedocs_conda_env.yml | 1 + pyproject.toml | 11 +++++------ trtools/__init__.py | 10 ++++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.readthedocs_conda_env.yml b/.readthedocs_conda_env.yml index 6691af7c..d5dab8cc 100644 --- a/.readthedocs_conda_env.yml +++ b/.readthedocs_conda_env.yml @@ -8,6 +8,7 @@ dependencies: - sphinx=3.0.4 - pytest - pytest-cov + - importlib-metadata - numpy - pybedtools - matplotlib-base diff --git a/pyproject.toml b/pyproject.toml index 37c37020..17f2284b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,10 @@ [build-system] -requires = ["setuptools", "setuptools-scm"] +requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] name = "trtools" +version = "5.1.1" authors = [ {name = "Melissa Gymrek", email = "mgymrek@ucsd.edu"}, {name = "Gymrek Lab"}, @@ -20,6 +21,7 @@ classifiers = [ "Topic :: Scientific/Engineering :: Bio-Informatics", ] dependencies = [ + "importlib-metadata", # required as long as we support py<3.8 "cyvcf2", "matplotlib", "numpy", @@ -31,16 +33,13 @@ dependencies = [ "statsmodels", "pyfaidx", ] -dynamic = ["version"] [tool.setuptools] -packages = ["trtools"] script-files = ["trtools/testsupport/test_trtools.sh", "scripts/trtools_prep_beagle_vcf.sh"] license-files = ["LICENSE.txt"] -[tool.setuptools_scm] -# generated automatically by setuptools when running pip install -e or python -m build -version_file = "trtools/version.py" +[tool.setuptools.packages.find] +exclude = ["trtools.testsupport.*", "doc"] [project.scripts] dumpSTR = "trtools.dumpSTR:run" diff --git a/trtools/__init__.py b/trtools/__init__.py index e6d1bc83..5d14e362 100644 --- a/trtools/__init__.py +++ b/trtools/__init__.py @@ -1,4 +1,10 @@ try: - from .version import __version__ -except ModuleNotFoundError: + from importlib.metadata import version, PackageNotFoundError +except ImportError: + # handles py3.7, since importlib.metadata was introduced in py3.8 + from importlib_metadata import version, PackageNotFoundError + +try: + __version__ = version(__name__) +except PackageNotFoundError: __version__ = "unknown" From 845c7ff69ac5229bb30fdf78b2c40bbc12422fdb Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Fri, 24 Nov 2023 22:02:36 +0000 Subject: [PATCH 3/4] instruct publishers to increment version in pyproject --- PUBLISHING.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PUBLISHING.rst b/PUBLISHING.rst index fdf9e6f3..e0d1a04b 100644 --- a/PUBLISHING.rst +++ b/PUBLISHING.rst @@ -43,18 +43,19 @@ Once changes have been made to develop that are ready to be published, first cho Then go through the steps of merging the changes into the master branch: #. Run :code:`pytest` and make sure all the tests pass. Then run :code:`./test/cmdline_tests.sh` and make sure those tests pass. +#. Update the version number listed in the :code:`pyproject.toml` file. #. Change the 'Unreleased Changes' section of :code:`RELEASE_NOTES.rst` to the new version number. #. Check if any changes have been made that have not yet been documented in the release notes. If so, document them. -#. Submit a pull request from develop into master on the github webiste. +#. Submit a pull request from develop into master on the github website. #. If the code review checks pass, merge the pull request. #. Tag the merge commit with the package version in vX.Y.Z format. (For more details on tagging, see `below`) Then go through the steps of publishing the changed code to PyPI: -1. :code:`cd` into the root of your clone of the trtools repo, checkout master and pull the latest change. Note that the most recent commit *must* be tagged. +1. :code:`cd` into the root of your clone of the trtools repo, checkout master and pull the latest change. The most recent commit should be tagged. 2. Run :code:`rm -rf build dist *.egg-info` to make sure all previous build artifacts are removed 3. Run :code:`python -m build` to build the package with the version number you just tagged. (Note: you might need to install ``build`` first.) -5. Run :code:`twine upload dist/*` to upload the distribution to PyPI +4. Run :code:`twine upload dist/*` to upload the distribution to PyPI Lastly, the change needs to be published to bioconda. From 4fc6985067b553518e42d5d25139e115c41f9146 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Fri, 24 Nov 2023 22:03:12 +0000 Subject: [PATCH 4/4] update changelog for v5.1.1 --- RELEASE_NOTES.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index fcfbff24..3db2629b 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -1,3 +1,10 @@ +5.1.1 +----- + +Bug fixes: + +* Remove stray files from source distribution + 5.1.0 -----