Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add windows ci #405

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/test-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: tests-windows

on:
push:
pull_request: null

jobs:
tests:
name: tests
strategy:
fail-fast: false
matrix:
os: [windows-latest]
pyver: ["3.11"]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.pyver }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyver }}

- name: Make nmake available
uses: ilammy/msvc-dev-cmd@v1

- name: install zlib
run: |
mkdir zlib-install
cd zlib-install

curl.exe --output zlib-1.3.1.zip https://zlib.net/zlib131.zip
unzip zlib-1.3.1.zip
cd zlib-1.3.1

cmake . -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release --target install

cd ..
cd ..

- name: install cfitsio
run: |
mkdir cfitsio-build
cd cfitsio-build

curl.exe --output cfitsio.zip --url https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfit-4.4.1.zip
unzip cfitsio.zip
cd cfitsio-4.4.1

mkdir build
cd build

cmake -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX="C:\Program Files (x86)" -D CMAKE_PREFIX_PATH="C:\Program Files (x86)" -D CMAKE_BUILD_TYPE=Release -D TESTS=On -D UTILS=On ..

nmake

nmake install

cd ..
cd ..
cd ..

- name: install numpy
run: pip install numpy

- name: Install code
run: pip install --no-deps -e .

- name: test
run: |
pip install pytest
pytest -vv fitsio
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
version 1.2.5 (not yet released)
-------------


version 1.2.4
-------------

Expand Down
2 changes: 1 addition & 1 deletion fitsio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
usage.
"""

__version__ = '1.2.4'
__version__ = '1.2.5'

from . import fitslib

Expand Down
2 changes: 1 addition & 1 deletion fitsio/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ def test_gz_write_read():
assert stat.st_size != 0, "Making sure the data was flushed to disk"


@pytest.mark.skipif('SKIP_BZIP_TEST' in os.environ,
@pytest.mark.skipif('SKIP_BZIP_TEST' in os.environ or os.name == 'nt',
reason='SKIP_BZIP_TEST set')
def test_bz2_read():
'''
Expand Down
39 changes: 21 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
import shutil


if "--use-system-fitsio" in sys.argv:
del sys.argv[sys.argv.index("--use-system-fitsio")]
if os.name == 'nt' or "--use-system-fitsio" in sys.argv:
if "--use-system-fitsio" in sys.argv:
del sys.argv[sys.argv.index("--use-system-fitsio")]
USE_SYSTEM_FITSIO = True
else:
USE_SYSTEM_FITSIO = False or "FITSIO_USE_SYSTEM_FITSIO" in os.environ
Expand Down Expand Up @@ -115,23 +116,25 @@ def build_extensions(self):
# directly for the compiler
self.compiler.include_dirs.insert(0, self.cfitsio_build_dir)

CCold = self.compiler.compiler
if 'ccache' in CCold:
CC = []
for val in CCold:
if val == 'ccache':
print("removing ccache from the compiler options")
continue
config_kw = {}
if os.name != 'nt':
CCold = self.compiler.compiler
if 'ccache' in CCold:
CC = []
for val in CCold:
if val == 'ccache':
print("removing ccache from the compiler options")
continue

CC.append(val)
else:
CC = None

CC.append(val)
else:
CC = None
config_kw['CC'] = CC
config_kw['ARCHIVE'] = self.compiler.archiver
config_kw['RANLIB'] = self.compiler.ranlib

self.configure_cfitsio(
CC=CC,
ARCHIVE=self.compiler.archiver,
RANLIB=self.compiler.ranlib,
)
self.configure_cfitsio(**config_kw)

# If configure detected bzlib.h, we have to link to libbz2
with open(os.path.join(self.cfitsio_build_dir, 'Makefile')) as fp:
Expand Down Expand Up @@ -318,7 +321,7 @@ def check_system_cfitsio_objects(self, obj_name):

setup(
name="fitsio",
version="1.2.4",
version="1.2.5",
description=description,
long_description=long_description,
long_description_content_type='text/markdown; charset=UTF-8; variant=GFM',
Expand Down
Loading