From 47e4a6be4bbdf7d72849111b02918f0a411ab485 Mon Sep 17 00:00:00 2001 From: Yangyang Li Date: Tue, 31 Oct 2023 16:02:42 -0500 Subject: [PATCH] feat: use setuppy --- .github/workflows/release.yml | 16 +++++----- pyproject.toml | 16 +++++++--- setup.py | 59 +++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 13 deletions(-) create mode 100644 setup.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0bbd79a4..b5d94aba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -116,14 +116,15 @@ jobs: build_wheels_macos: name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}" runs-on: ${{ matrix.os }} - needs: ["release"] - if: needs.release.outputs.tag + # needs: ["release"] + # if: needs.release.outputs.tag strategy: fail-fast: false matrix: os: [macos-latest] - cibw_build: ["cp39-*", "cp310-*", "cp311-*"] + # cibw_build: ["cp39-*", "cp310-*", "cp311-*"] + cibw_build: ["cp39-*"] cibw_archs: ["x86_64"] env: SYSTEM_VERSION_COMPAT: 0 # https://github.com/actions/setup-python/issues/469#issuecomment-1192522949 @@ -150,7 +151,6 @@ jobs: CIBW_BUILD: ${{ matrix.cibw_build }} CIBW_ARCHS: ${{ matrix.cibw_archs }} CIBW_TEST_SKIP: "*-macosx_arm64" - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" - uses: actions/upload-artifact@v3 with: @@ -159,14 +159,14 @@ jobs: build_wheels_macos_arm64: name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}" runs-on: ${{ matrix.os }} - needs: ["release"] + # needs: ["release"] # if: needs.release.outputs.tag strategy: matrix: - os: [macos-latest-xlarge] + os: [macos-latest] # cibw_build: ["cp38-*", "cp39-*", "cp310-*", "cp311-*"] cibw_build: ["cp39-*"] - cibw_archs: ["native"] + cibw_archs: ["arm64"] steps: - name: Check out repository @@ -183,7 +183,7 @@ jobs: env: CIBW_BUILD: ${{ matrix.cibw_build }} CIBW_ARCHS: ${{ matrix.cibw_archs }} - # CIBW_TEST_SKIP: "*-macosx_arm64" + CIBW_TEST_SKIP: "*-macosx_arm64" - uses: actions/upload-artifact@v3 with: diff --git a/pyproject.toml b/pyproject.toml index 61c3511c..e3c35bf8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,8 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: C", + "Programming Language :: C++", ] keywords = ["bioinformatics", "sequence aligner", "blat"] @@ -174,6 +176,7 @@ exclude = [ "scripts/*", "noxfile.py", "docs/conf.py", + "setup.py", ".bzr", ".direnv", @@ -288,10 +291,13 @@ test-requires = "pytest" test-command = "pytest {project}/tests -vls -m imports" -[tool.poetry.build] -script = "build.py" -generate-setup-file = true +# [tool.poetry.build] +# script = "build.py" +# generate-setup-file = true +# [build-system] +# requires = ["pybind11>2.9.1", "poetry-core>=1.2.0", "setuptools>=40.8.0"] +# build-backend = "poetry.core.masonry.api" [build-system] -requires = ["pybind11>2.9.1", "poetry-core>=1.2.0", "setuptools>=40.8.0"] -build-backend = "poetry.core.masonry.api" +requires = ["setuptools", "wheel", "pybind11"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..213e831d --- /dev/null +++ b/setup.py @@ -0,0 +1,59 @@ +from setuptools import setup + +package_dir = {"": "src"} + +packages = ["pxblat", "pxblat.cli", "pxblat.extc", "pxblat.server", "pxblat.toolkit"] + +package_data = { + "": ["*"], + "pxblat.extc": [ + "bindings/*", + "bindings/binder/*", + "include/*", + "include/aux/*", + "include/core/*", + "include/net/*", + "src/*", + "src/aux/*", + "src/core/*", + "src/net/*", + ], +} + +install_requires = [ + "biopython>=1.81,<2.0", + "deprecated>=1.2.13,<2.0.0", + "loguru>=0.7.0,<0.8.0", + "mashumaro>=3.7,<4.0", + "pybind11>=2.10.4,<3.0.0", + "pysimdjson>=5.0.2,<6.0.0", + "rich>=13.3.5,<14.0.0", + "setuptools>=68.2.2,<69.0.0", + "typer>=0.9.0,<0.10.0", + "urllib3==2.0.7", +] + +entry_points = {"console_scripts": ["pxblat = pxblat.cli.cli:app"]} + +setup_kwargs = { + "name": "pxblat", + "version": "1.1.8", + "description": "A native python binding for blat suite", + "long_description": '# logo **PxBLAT** [![social](https://img.shields.io/github/stars/cauliyang/pxblat?style=social)](https://github.com/cauliyang/pxblat/stargazers)\n\n_An Efficient and Ergonomic Python Binding Library for BLAT_\n\n[![python](https://img.shields.io/badge/Python-3776AB.svg?style=for-the-badge&logo=Python&logoColor=white)](https://www.python.org/)\n[![c++](https://img.shields.io/badge/C++-00599C.svg?style=for-the-badge&logo=C++&logoColor=white)](https://en.cppreference.com/w/)\n[![c](https://img.shields.io/badge/C-A8B9CC.svg?style=for-the-badge&logo=C&logoColor=black)](https://www.gnu.org/software/gnu-c-manual/)\n[![pypi](https://img.shields.io/pypi/v/pxblat.svg?style=for-the-badge)][pypi]\n[![conda](https://img.shields.io/conda/vn/bioconda/pxblat?style=for-the-badge)][conda]\n![Linux](https://img.shields.io/badge/-Linux-grey?logo=linux&style=for-the-badge)\n![macOS](https://img.shields.io/badge/-OSX-black?logo=apple&style=for-the-badge)\n[![pyversion](https://img.shields.io/pypi/pyversions/pxblat?style=for-the-badge)][pypi]\n[![tests](https://img.shields.io/github/actions/workflow/status/cauliyang/pxblat/tests.yml?style=for-the-badge&logo=github&label=Tests)](https://github.com/cauliyang/pxblat/actions/workflows/tests.yml)\n[![Codecov](https://img.shields.io/codecov/c/github/cauliyang/pxblat/main?style=for-the-badge)](https://app.codecov.io/gh/cauliyang/pxblat)\n[![docs](https://img.shields.io/readthedocs/pxblat?style=for-the-badge)](https://pxblat.readthedocs.io/en/latest/)\n[![download](https://img.shields.io/pypi/dm/pxblat?logo=pypi&label=pypi%20download&style=for-the-badge)][pypi]\n[![condadownload](https://img.shields.io/conda/dn/bioconda/pxblat?style=for-the-badge&logo=anaconda&label=Conda%20Download)][conda]\n[![precommit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?style=for-the-badge&logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg?style=for-the-badge)](https://github.com/charliermarsh/ruff)\n[![release](https://img.shields.io/github/release-date/cauliyang/pxblat?style=for-the-badge)](https://github.com/cauliyang/pxblat/releases)\n[![open-issue](https://img.shields.io/github/issues-raw/cauliyang/pxblat?style=for-the-badge)][open-issue]\n[![close-issue](https://img.shields.io/github/issues-closed-raw/cauliyang/pxblat?style=for-the-badge)][close-issue]\n[![activity](https://img.shields.io/github/commit-activity/m/cauliyang/pxblat?style=for-the-badge)][repo]\n[![lastcommit](https://img.shields.io/github/last-commit/cauliyang/pxblat?style=for-the-badge)][repo]\n[![opull](https://img.shields.io/github/issues-pr-raw/cauliyang/pxblat?style=for-the-badge)][opull]\n[![all contributors](https://img.shields.io/github/all-contributors/cauliyang/pxblat?style=for-the-badge)](#contributors)\n\n\n\n[repo]: https://github.com/ylab-hi/pxblat\n[open-issue]: https://github.com/cauliyang/pxblat/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc\n[close-issue]: https://github.com/cauliyang/pxblat/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed\n[opull]: https://github.com/cauliyang/pxblat/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc\n[conda]: https://bioconda.github.io/recipes/pxblat/README.html\n[pypi]: https://pypi.org/project/pxblat/\n[colab]: https://colab.research.google.com/drive/1TXb9GBmYa2EYezwBKbD-y9Xg6MC2gL36\n\n## Why PxBLAT?\n\nWhen conducting extensive queries, using the `blat` of `BLAT` suite can prove to be quite inefficient, especially if these operations aren\'t grouped. The tasks are allocated sporadically, often interspersed among other tasks.\nIn general, the choice narrows down to either utilizing `blat` or combining `gfServer` with `gfClient`.\nIndeed, `blat` is a program that launches `gfServer`, conducts the sequence query via `gfClient`, and then proceeds to terminate the server.\n\nThis approach is far from ideal when performing numerous queries that aren\'t grouped since `blat` repeatedly initializes and shuts down `gfServer` for each query, resulting in substantial overhead.\nThis overhead consists of the time required for the server to index the reference, contingent on the reference\'s size.\nTo index the human genome (hg38), for example, would take approximately five minutes.\n\nA more efficient solution would involve initializing `gfServer` once and invoking `gfClient` multiple times for the queries.\nHowever, `gfServer` and `gfClient` are only accessible via the command line.\nThis necessitates managing system calls (for instance, `subprocess` or `os.system`), intermediate temporary files, and format conversion, further diminishing performance.\n\nThat is why `PxBLAT` holds its position.\nIt resolves the issues mentioned above while introducing handy features like `port retry`, `use current running server`, etc.\n\n## 📚 **Table of Contents**\n\n- [ **PxBLAT** ](#-pxblat-)\n - [📚 **Table of Contents**](#-table-of-contents)\n - [🔮 **Features**](#-features)\n - [📎 **Citation**](#-citation)\n - [🚀 **Getting Started**](#-getting-started)\n - [🤝 **Contributing**](#-contributing)\n - [\U0001faaa **License**](#-license)\n - [🤗 **Contributors**](#contributors)\n - [🙏 **Acknowledgments**](#-acknowledgments)\n\n## 🔮 **Features**\n\n- **Zero System Calls**: Avoids system calls, leading to a smoother, quicker operation.
\n- **Ergonomics**: With an ergonomic design, `PxBLAT` aims for a seamless user experience.
\n- **No External Dependencies**: `PxBLAT` operates independently without any external dependencies.
\n- **Self-Monitoring**: No need to trawl through log files; `PxBLAT` monitors its status internally.
\n- **Robust Validation**: Extensively tested to ensure reliable performance and superior stability as BLAT.
\n- **Format-Agnostic:** `PxBLAT` doesn\'t require you to worry about file formats.
\n- **In-Memory Processing**: `PxBLAT` discards the need for intermediate files by doing all its operations in memory, ensuring speed and efficiency.
\n\n## 📎 **Citation**\n\nPxBLAT is scientific software, with a published paper in the BioRxiv.\nCheck the [published](https://www.biorxiv.org/content/10.1101/2023.08.02.551686v2) to read the paper.\n\n```bibtex\n@article {Li2023pxblat,\n\tauthor = {Yangyang Li and Rendong Yang},\n\ttitle = {PxBLAT: An Ergonomic and Efficient Python Binding Library for BLAT},\n\telocation-id = {2023.08.02.551686},\n\tyear = {2023},\n\tdoi = {10.1101/2023.08.02.551686},\n\tpublisher = {Cold Spring Harbor Laboratory},\n\turl = {https://www.biorxiv.org/content/10.1101/2023.08.02.551686v2},\n\tjournal = {bioRxiv}\n}\n```\n\n## 🚀 **Getting Started**\n\nWelcome to PxBLAT! To kickstart your journey and get the most out of this tool, we have prepared a comprehensive [documentation](https://pxblat.readthedocs.io/en/latest/installation.html).\nInside, you’ll find detailed guides, examples, and all the necessary information to help you navigate and utilize PxBLAT effectively.\n\n### Need Help or Found an Issue?\n\nIf you encounter any issues or if something is not clear in the documentation, do not hesitate to [open an issue](https://github.com/ylab-hi/pxblat/issues/new/choose).\nWe are here to help and appreciate your feedback for improving PxBLAT.\n\n### Show Your Support\n\nIf PxBLAT has been beneficial to your projects or you appreciate the work put into it, consider leaving a ⭐️ [Star](https://github.com/ylab-hi/pxblat/stargazers) on our GitHub repository.\nYour support means the world to us and motivates us to continue enhancing PxBLAT.\n\nLet’s embark on this journey together and make the most out of PxBLAT! 🎉\nPlease see the [document](https://pxblat.readthedocs.io/en/latest/installation.html) for details and more examples.\n\n## 🤝 **Contributing**\n\nContributions are always welcome! Please follow these steps:\n\n1. Fork the project repository. This creates a copy of the project on your account that you can modify without affecting the original project.\n2. Clone the forked repository to your local machine using a Git client like Git or GitHub Desktop.\n3. Create a new branch with a descriptive name (e.g., `new-feature-branch` or `bugfix-issue-123`).\n\n```bash\ngit checkout -b new-feature-branch\n```\n\n4. Take changes to the project\'s codebase.\n5. Install the latest package\n\n```bash\npoetry install\n```\n\n6. Test your changes\n\n```bash\npytest -vlsx tests\n```\n\n7. Commit your changes to your local branch with a clear commit message that explains the changes you\'ve made.\n\n```bash\ngit commit -m \'Implemented new feature.\'\n```\n\n8. Push your changes to your forked repository on GitHub using the following command\n\n```bash\ngit push origin new-feature-branch\n```\n\nCreate a pull request to the original repository.\nOpen a new pull request to the original project repository. In the pull request, describe the changes you\'ve made and why they\'re necessary.\nThe project maintainers will review your changes and provide feedback or merge them into the main branch.\n\n## \U0001faaa **License**\n\n**PxBLAT is modified from blat, the license is the same as blat. The source code and\nexecutables are freely available for academic, nonprofit, and personal use.\nCommercial licensing information is available on the Kent Informatics website\n(https://kentinformatics.com/).**\n\n## **Contributors**\n\n\n\n\n\n \n \n \n \n \n \n
yangliz5
yangliz5

🚧
Joshua Zhuang
Joshua Zhuang

🚇
\n\n\n\n\n\n\n\n\n\n\n\n\n\n## 🙏 **Acknowledgments**\n\n- [BLAT](http://genome.ucsc.edu/goldenPath/help/blatSpec.html)\n- [UCSC](https://github.com/ucscGenomeBrowser/kent)\n- [pybind11](https://github.com/pybind/pybind11/tree/stable)\n\n\n\n
\n\n \n \n Star History Chart\n\n', + "author": "Yangyang Li", + "author_email": "yangyang.li@northwestern.edu", + "maintainer": "None", + "maintainer_email": "None", + "url": "https://github.com/ylab-hi/pxblat", + "package_dir": package_dir, + "packages": packages, + "package_data": package_data, + "install_requires": install_requires, + "entry_points": entry_points, + "python_requires": ">=3.9,<3.12", +} +from build import * + +build(setup_kwargs) + +setup(**setup_kwargs)