Skip to content

Commit

Permalink
Merge branch 'main' into github_actions_32bit_test
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-c authored Jul 3, 2024
2 parents f95eabd + b6e40e7 commit ac2ccfd
Show file tree
Hide file tree
Showing 374 changed files with 7,512 additions and 6,455 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Format Python code with black and isort
a100c005f0714ebca78ec7770f770d6522b3b870
51 changes: 31 additions & 20 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,48 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
arch: [auto]
include:
- os: ubuntu-latest
arch: aarch64
archs: auto
- os: macos-latest
archs: x86_64 arm64
- os: ubuntu-latest
archs: aarch64
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Set up QEMU to build non-native architectures
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v1
if: ${{ matrix.archs == 'aarch64' }}
uses: docker/setup-qemu-action@v3
- name: Install required Python packages
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install 'cibuildwheel>=2.2.0' twine
- name: Build wheels
run: python -m cibuildwheel --output-dir dist
env:
CIBW_ARCHS: ${{matrix.arch}}
# Skip building musllinux wheels for aarch64, each one currently takes
# more than 2 hours to build.
CIBW_SKIP: '*-musllinux_aarch64'
CIBW_ARCHS: ${{ matrix.archs }}
# Skip building musllinux wheels for the CPython versions for which the
# numpy version we build against doesn't have musllinux wheels on PyPI.
# Skip building for PyPy 3.8, which is deprecated upstream.
# Skip building for PyPy on i686 since NumPy 2.0 fails to build on it.
CIBW_SKIP: "cp38-musllinux_* pp38-* pp*-manylinux_i686"
- name: Check packages
run: twine check dist/*
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: packages
name: "packages-${{ matrix.os }}-${{ matrix.archs }}"
path: dist/

build_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install required Python packages
run: |
python -m pip install --upgrade pip setuptools wheel
Expand All @@ -57,21 +65,24 @@ jobs:
python -c 'import bx, bx.align, bx.align.sitemask, bx.align.tools, bx.arrays, bx.bbi, bx.cookbook, bx.intervals, bx.intervals.operations, bx.intseq, bx.misc, bx.motif, bx.motif.io, bx.motif.logo, bx.phylo, bx.pwm, bx.seq, bx.tabular, bx_extras'
- name: Check packages
run: twine check dist/*
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: packages
name: packages-sdist
path: dist/

upload_pypi:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && github.repository_owner == 'bxlab'
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: packages
merge-multiple: true
path: dist
pattern: packages-*
- name: Display structure of downloaded files
run: ls -R dist/
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && github.repository_owner == 'bxlab'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.9']
python-version: ['3.8', '3.12']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install flake8
run: pip install flake8 flake8-import-order
- name: Install tox
run: pip install tox
- name: Lint
run: flake8 .
run: tox -e lint
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install liblzo2-dev
run: sudo apt-get update && sudo apt-get -y install liblzo2-dev
- name: Install tox
run: pip install tox
- name: Test
run: tox
run: tox -e test
test-32bit:
runs-on: ubuntu-latest
strategy:
Expand All @@ -53,4 +53,4 @@ jobs:
run: export PYTHON=python3.7 && sudo -H $PYTHON -m pip install -U pip \
&& sudo -H $PYTHON -m pip install wheel virtualenv setuptools tox
- name: Test
run: tox
run: tox -e test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ nose*.egg

# Built sdist directory
dist

# Testing
.tox/
11 changes: 11 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[settings]
force_alphabetical_sort_within_sections=true
# Override force_grid_wrap value from profile=black, but black is still happy
force_grid_wrap=2
known_first_party=bx,bx_extras
# Same line length as for black
line_length=120
no_lines_before=LOCALFOLDER
profile=black
reverse_relative=true
skip_gitignore=true
27 changes: 27 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: doc/source/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- path: .
- requirements: doc/requirements.txt
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ recursive-include src *.c
recursive-include lib *.h
recursive-include lib *.c
recursive-include lib *.pyx
recursive-include lib *.pxd
103 changes: 20 additions & 83 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,83 +1,20 @@
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source

.PHONY: help clean html web pickle htmlhelp latex changes linkcheck

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " apidoc to run epydoc"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " changes to make an overview over all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"

clean:
-rm -rf docbuild/*

html:
mkdir -p build/html build/doctrees
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) docbuild/html
@echo
@echo "Build finished. The HTML pages are in docbuild/html."

apidoc:
mkdir -p build/html/apidoc
epydoc-2.6 --docformat restructuredtext ../lib/bx -o docbuild/html/apidoc
@echo
@echo "Epydoc finished. The pages are in docbuild/html/apidoc."


pickle:
mkdir -p build/pickle build/doctrees
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) docbuild/pickle
@echo
@echo "Build finished; now you can process the pickle files."

web: pickle

json:
mkdir -p build/json build/doctrees
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) docbuild/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
mkdir -p build/htmlhelp build/doctrees
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) docbuild/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in build/htmlhelp."

latex:
mkdir -p build/latex build/doctrees
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) docbuild/latex
@echo
@echo "Build finished; the LaTeX files are in build/latex."
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
"run these through (pdf)latex."

changes:
mkdir -p build/changes build/doctrees
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) docbuild/changes
@echo
@echo "The overview file is in build/changes."

linkcheck:
mkdir -p build/linkcheck build/doctrees
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) docbuild/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in build/linkcheck/output.txt."
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
3 changes: 2 additions & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
https://bitbucket.org/james_taylor/python-lzo-static/get/63987d89fd1b.zip
numpy
sphinx
sphinx-rtd-theme
Loading

0 comments on commit ac2ccfd

Please sign in to comment.