diff --git a/.github/workflows/test-windows.yaml b/.github/workflows/test-windows.yaml new file mode 100644 index 00000000..d82cdd4b --- /dev/null +++ b/.github/workflows/test-windows.yaml @@ -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 diff --git a/CHANGES.md b/CHANGES.md index 047d3dc2..9900e818 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +version 1.2.5 (not yet released) +------------- + + version 1.2.4 ------------- diff --git a/fitsio/__init__.py b/fitsio/__init__.py index cca79d06..54ae40b7 100644 --- a/fitsio/__init__.py +++ b/fitsio/__init__.py @@ -5,7 +5,7 @@ usage. """ -__version__ = '1.2.4' +__version__ = '1.2.5' from . import fitslib diff --git a/fitsio/tests/test_table.py b/fitsio/tests/test_table.py index 9902324f..01387c50 100644 --- a/fitsio/tests/test_table.py +++ b/fitsio/tests/test_table.py @@ -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(): ''' diff --git a/setup.py b/setup.py index 707be3c2..e62fed01 100644 --- a/setup.py +++ b/setup.py @@ -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 @@ -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: @@ -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',