From 1edbf9bf4e3a241c9af299664cc63098d9e6ca46 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Tue, 4 Oct 2022 15:43:00 +0200 Subject: [PATCH 01/25] Add test github action. --- .github/workflows/test.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ede8960 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,12 @@ +name: Run tests +run-name: ${{github-actor}} testsing freesasa-python +on: [push] +jobs: + Run-Tests: + steps: + - run: echo "Running GHA" + - name: "Check out code" + uses: actions/checkout@v3 + - name: List files in the repository + run: | + ls ${{ github.workspace }} From c37624499e97b304d22729224ca4636cdca05ac9 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Tue, 4 Oct 2022 15:45:20 +0200 Subject: [PATCH 02/25] Add status. --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ede8960..de0faee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,3 +10,4 @@ jobs: - name: List files in the repository run: | ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." From 5dbd73bcc736f88182bdc46ab6ae4b83eea5924f Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Tue, 4 Oct 2022 15:46:15 +0200 Subject: [PATCH 03/25] Fix syntax error. --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de0faee..00fab49 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,6 @@ jobs: - name: "Check out code" uses: actions/checkout@v3 - name: List files in the repository - run: | - ls ${{ github.workspace }} + run: | + ls ${{ github.workspace }} - run: echo "🍏 This job's status is ${{ job.status }}." From 92e2612b6bd9f9737005f92c2748998446ab7489 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Tue, 4 Oct 2022 15:47:42 +0200 Subject: [PATCH 04/25] Fix syntax error. --- .github/workflows/test.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 00fab49..3d1b368 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,11 +3,12 @@ run-name: ${{github-actor}} testsing freesasa-python on: [push] jobs: Run-Tests: - steps: - - run: echo "Running GHA" - - name: "Check out code" - uses: actions/checkout@v3 - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." + runs-on: ubuntu-latest + steps: + - run: echo "Running GHA" + - name: "Check out code" + uses: actions/checkout@v3 + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." From 9d1466fb69730b4ab24dd5e0602db6268027a505 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Tue, 4 Oct 2022 15:48:33 +0200 Subject: [PATCH 05/25] Fix syntax error. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d1b368..da7ffa9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,5 @@ name: Run tests -run-name: ${{github-actor}} testsing freesasa-python +run-name: ${{ github.actor }} testsing freesasa-python on: [push] jobs: Run-Tests: From a8350debe9ed07128716037f9aaec1547ec6b9fc Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Tue, 4 Oct 2022 15:53:28 +0200 Subject: [PATCH 06/25] Add build and test. --- .github/workflows/test.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da7ffa9..33a8cef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,13 +2,24 @@ name: Run tests run-name: ${{ github.actor }} testsing freesasa-python on: [push] jobs: - Run-Tests: + build: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - - run: echo "Running GHA" - name: "Check out code" uses: actions/checkout@v3 - - name: List files in the repository + - name: "Get FreeSASA C library" + run: git submodule update --init + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." + python -m pip install --upgrade pip + pip install -r requirements.txt + python setup.py install + - name: Run tests + run: python setup.py test From 3ee7d00635a5443d529b75918dc03ddd560bacff Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Tue, 4 Oct 2022 15:57:20 +0200 Subject: [PATCH 07/25] Add USE_CYTHON and pip cache. --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33a8cef..269eeb7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,10 +16,11 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: "pip" - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt python setup.py install - name: Run tests - run: python setup.py test + run: USE_CYTHON=1 python setup.py test From 7877ea6b7f6a457974ea379f23c5b86cf6839ef5 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Tue, 4 Oct 2022 16:00:27 +0200 Subject: [PATCH 08/25] Simpler setup for basic tests. --- .github/workflows/test.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 269eeb7..ffd86eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,12 +1,9 @@ name: Run tests -run-name: ${{ github.actor }} testsing freesasa-python +run-name: ${{ github.actor }} testing freesasa-python on: [push] jobs: - build: + Test: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - name: "Check out code" uses: actions/checkout@v3 @@ -15,7 +12,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: "3.10" cache: "pip" - name: Install dependencies run: | From 9d6b34c09cef8840fbcba2068c15c71e88e421e5 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 18:38:27 +0200 Subject: [PATCH 09/25] Add more comprehensive tests for master branch. --- .github/workflows/test-push-master.yml | 27 +++++++++++++++++++ .github/workflows/{test.yml => test-push.yml} | 4 ++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test-push-master.yml rename .github/workflows/{test.yml => test-push.yml} (94%) diff --git a/.github/workflows/test-push-master.yml b/.github/workflows/test-push-master.yml new file mode 100644 index 0000000..98b00d6 --- /dev/null +++ b/.github/workflows/test-push-master.yml @@ -0,0 +1,27 @@ +name: Run tests on several python versions +run-name: ${{ github.actor }} testing freesasa-python +on: + push: + branches: master +jobs: + Test: + runs-on: ubuntu-latest + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10"] + steps: + - name: "Check out code" + uses: actions/checkout@v3 + - name: "Get FreeSASA C library" + run: git submodule update --init + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: "3.10" + cache: "pip" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + python setup.py install + - name: Run tests + run: USE_CYTHON=1 python setup.py test diff --git a/.github/workflows/test.yml b/.github/workflows/test-push.yml similarity index 94% rename from .github/workflows/test.yml rename to .github/workflows/test-push.yml index ffd86eb..6de06c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test-push.yml @@ -1,6 +1,8 @@ name: Run tests run-name: ${{ github.actor }} testing freesasa-python -on: [push] +on: + push: + branches-ignore: master jobs: Test: runs-on: ubuntu-latest From 49543cfab0c43917d1363f465fe481b860a6b93d Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 18:39:30 +0200 Subject: [PATCH 10/25] Fix conflicting python versions. --- .github/workflows/test-push-master.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-push-master.yml b/.github/workflows/test-push-master.yml index 98b00d6..cbd7233 100644 --- a/.github/workflows/test-push-master.yml +++ b/.github/workflows/test-push-master.yml @@ -16,7 +16,6 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: - python-version: "3.10" cache: "pip" - name: Install dependencies run: | From 3c081636aba658af6ebcff4f903f970a3406ba77 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 18:39:58 +0200 Subject: [PATCH 11/25] Remove travis and appveyor configs. --- .travis.yml | 64 ----------- appveyor.yml | 110 ------------------ appveyor/install.ps1 | 229 -------------------------------------- appveyor/run_with_env.cmd | 88 --------------- 4 files changed, 491 deletions(-) delete mode 100644 .travis.yml delete mode 100644 appveyor.yml delete mode 100644 appveyor/install.ps1 delete mode 100644 appveyor/run_with_env.cmd diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 20dc540..0000000 --- a/.travis.yml +++ /dev/null @@ -1,64 +0,0 @@ -# A lot of inspiration from https://github.com/project-rig/rig_c_sa - -# could be done using language python and a more complicated matrix, -# but this allows us to use the same setup on mac and linux -language: generic - -sudo: false - -cache: - directories: - - "$HOME/.cache/pip" - - "$HOME/.pyenv_cache" - -dist: xenial -os: - - linux - - osx - -env: - matrix: - - PYVER=3.7 - - PYVER=3.8 - - PYVER=3.9 - global: - - USE_CYTHON=1 - -install: - # Install 'pyenv': a utility for downloading and switching between multiple - # Python interpreters on the same system. - - git clone https://github.com/yyuu/pyenv.git ~/.pyenv - - PYENV_ROOT="$HOME/.pyenv" - - PATH="$PYENV_ROOT/bin:$PATH" - - eval "$(pyenv init --path)" - # Install the latest release of the specified Python version using pyenv. - - PYVER="$(pyenv install --list | grep -E "^\\s*$PYVER" | sort -n -t. -k3 | tail -n1)" - - echo "Selected Python $PYVER" - - pyenv install $PYVER - # Make the newly installed version the default "python" command. - - pyenv global $PYVER - - python --version - - pip install --upgrade pip - - pip install -r requirements.txt - - git submodule update --init - -script: - - python setup.py install - - python setup.py test - -after_success: - - > - if [ -n "$TRAVIS_TAG" ]; then - # can only upload binaries for osx - if [ "x$TRAVIS_OS_NAME" == "xosx" ]; then - python setup.py bdist_wheel; - # only submit sdist once - if [ "x$PYVER" == "x3.8" ]; then - python setup.py sdist - fi - fi - # twine env variables are set in Travis web config - twine upload --skip-existing dist/*; - else - echo "Will only deploy tagged releases" - fi diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 504460e..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,110 +0,0 @@ -environment: - global: - # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the - # /E:ON and /V:ON options are not enabled in the batch script intepreter - # See: http://stackoverflow.com/a/13751649/163740 - CMD_IN_ENV: "cmd /E:ON /V:O N /C .\\appveyor\\run_with_env.cmd" - USE_CYTHON: 1 - REQUIREMENTS: requirements.txt - TWINE_USERNAME: mittinatten - TWINE_PASSWORD: - secure: PE3DJXf2VYmUlH1Vo6CoMA== - - matrix: - # Pre-installed Python versions, which Appveyor may upgrade to - # a later point release. - # See: http://www.appveyor.com/docs/installed-software#python - - - PYTHON: "C:\\Python36" - PYTHON_VERSION: "3.6.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python36-x64" - PYTHON_VERSION: "3.6.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python37" - PYTHON_VERSION: "3.7.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python37-x64" - PYTHON_VERSION: "3.7.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python38" - PYTHON_VERSION: "3.8.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python38-x64" - PYTHON_VERSION: "3.8.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python39" - PYTHON_VERSION: "3.9.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python39-x64" - PYTHON_VERSION: "3.9.x" - PYTHON_ARCH: "64" - -install: - # If there is a newer build queued for the same PR, cancel this one. - # The AppVeyor 'rollout builds' option is supposed to serve the same - # purpose but it is problematic because it tends to cancel builds pushed - # directly to master instead of just PR builds (or the converse). - # credits: JuliaLang developers. - - ps: - if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` - https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` - Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` - throw "There are newer queued builds for this pull request, failing early." } - - ECHO "Filesystem root:" - - ps: 'ls "C:/"' - - - ECHO "Installed SDKs:" - - ps: 'ls "C:/Program Files/Microsoft SDKs/Windows"' - - # Install Python (from the official .msi of http://python.org) and pip when - # not already installed. - - ps: if (-not(Test-Path($env:PYTHON))) { & appveyor\install.ps1 } - - # Prepend newly installed Python to the PATH of this build (this cannot be - # done from inside the powershell script as it would require to restart - # the parent CMD process). - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - - # Check that we have the expected version and architecture for Python - - "python --version" - - 'python -c "import struct; print(struct.calcsize(''P'') * 8)"' - - # Upgrade to the latest version of pip to avoid it displaying warnings - # about it being out of date. - - "python -m pip install --upgrade pip" - - # Install the build dependencies of the project. If some dependencies contain - # compiled extensions and are not provided as pre-built wheel packages, - # pip will build them from source using the MSVC compiler matching the - # target Python version and architecture - - "%CMD_IN_ENV% pip install -r %REQUIREMENTS%" - - - git submodule update --init - -build_script: - # Build the compiled extension - - "%CMD_IN_ENV% python setup.py build" - -test_script: - # Run the project tests - - "%CMD_IN_ENV% python setup.py test" - -after_test: - # If tests are successful, create binary packages for the project. - - "%CMD_IN_ENV% python setup.py bdist_wheel" - - ps: "ls dist" - -artifacts: - - path: dist\* - name: pypiartifacts - -deploy_script: - - if "%APPVEYOR_REPO_TAG%"=="true" ( twine upload dist\* --skip-existing ) else ( echo "Will only deploy tagged commits" ) diff --git a/appveyor/install.ps1 b/appveyor/install.ps1 deleted file mode 100644 index 160ba55..0000000 --- a/appveyor/install.ps1 +++ /dev/null @@ -1,229 +0,0 @@ -# Sample script to install Python and pip under Windows -# Authors: Olivier Grisel, Jonathan Helmus, Kyle Kastner, and Alex Willmer -# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ - -$MINICONDA_URL = "http://repo.continuum.io/miniconda/" -$BASE_URL = "https://www.python.org/ftp/python/" -$GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" -$GET_PIP_PATH = "C:\get-pip.py" - -$PYTHON_PRERELEASE_REGEX = @" -(?x) -(?\d+) -\. -(?\d+) -\. -(?\d+) -(?[a-z]{1,2}\d+) -"@ - - -function Download ($filename, $url) { - $webclient = New-Object System.Net.WebClient - - $basedir = $pwd.Path + "\" - $filepath = $basedir + $filename - if (Test-Path $filename) { - Write-Host "Reusing" $filepath - return $filepath - } - - # Download and retry up to 3 times in case of network transient errors. - Write-Host "Downloading" $filename "from" $url - $retry_attempts = 2 - for ($i = 0; $i -lt $retry_attempts; $i++) { - try { - $webclient.DownloadFile($url, $filepath) - break - } - Catch [Exception]{ - Start-Sleep 1 - } - } - if (Test-Path $filepath) { - Write-Host "File saved at" $filepath - } else { - # Retry once to get the error message if any at the last try - $webclient.DownloadFile($url, $filepath) - } - return $filepath -} - - -function ParsePythonVersion ($python_version) { - if ($python_version -match $PYTHON_PRERELEASE_REGEX) { - return ([int]$matches.major, [int]$matches.minor, [int]$matches.micro, - $matches.prerelease) - } - $version_obj = [version]$python_version - return ($version_obj.major, $version_obj.minor, $version_obj.build, "") -} - - -function DownloadPython ($python_version, $platform_suffix) { - $major, $minor, $micro, $prerelease = ParsePythonVersion $python_version - - if (($major -le 2 -and $micro -eq 0) ` - -or ($major -eq 3 -and $minor -le 2 -and $micro -eq 0) ` - ) { - $dir = "$major.$minor" - $python_version = "$major.$minor$prerelease" - } else { - $dir = "$major.$minor.$micro" - } - - if ($prerelease) { - if (($major -le 2) ` - -or ($major -eq 3 -and $minor -eq 1) ` - -or ($major -eq 3 -and $minor -eq 2) ` - -or ($major -eq 3 -and $minor -eq 3) ` - ) { - $dir = "$dir/prev" - } - } - - if (($major -le 2) -or ($major -le 3 -and $minor -le 4)) { - $ext = "msi" - if ($platform_suffix) { - $platform_suffix = ".$platform_suffix" - } - } else { - $ext = "exe" - if ($platform_suffix) { - $platform_suffix = "-$platform_suffix" - } - } - - $filename = "python-$python_version$platform_suffix.$ext" - $url = "$BASE_URL$dir/$filename" - $filepath = Download $filename $url - return $filepath -} - - -function InstallPython ($python_version, $architecture, $python_home) { - Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home - if (Test-Path $python_home) { - Write-Host $python_home "already exists, skipping." - return $false - } - if ($architecture -eq "32") { - $platform_suffix = "" - } else { - $platform_suffix = "amd64" - } - $installer_path = DownloadPython $python_version $platform_suffix - $installer_ext = [System.IO.Path]::GetExtension($installer_path) - Write-Host "Installing $installer_path to $python_home" - $install_log = $python_home + ".log" - if ($installer_ext -eq '.msi') { - InstallPythonMSI $installer_path $python_home $install_log - } else { - InstallPythonEXE $installer_path $python_home $install_log - } - if (Test-Path $python_home) { - Write-Host "Python $python_version ($architecture) installation complete" - } else { - Write-Host "Failed to install Python in $python_home" - Get-Content -Path $install_log - Exit 1 - } -} - - -function InstallPythonEXE ($exepath, $python_home, $install_log) { - $install_args = "/quiet InstallAllUsers=1 TargetDir=$python_home" - RunCommand $exepath $install_args -} - - -function InstallPythonMSI ($msipath, $python_home, $install_log) { - $install_args = "/qn /log $install_log /i $msipath TARGETDIR=$python_home" - $uninstall_args = "/qn /x $msipath" - RunCommand "msiexec.exe" $install_args - if (-not(Test-Path $python_home)) { - Write-Host "Python seems to be installed else-where, reinstalling." - RunCommand "msiexec.exe" $uninstall_args - RunCommand "msiexec.exe" $install_args - } -} - -function RunCommand ($command, $command_args) { - Write-Host $command $command_args - Start-Process -FilePath $command -ArgumentList $command_args -Wait -Passthru -} - - -function InstallPip ($python_home) { - $pip_path = $python_home + "\Scripts\pip.exe" - $python_path = $python_home + "\python.exe" - if (-not(Test-Path $pip_path)) { - Write-Host "Installing pip..." - $webclient = New-Object System.Net.WebClient - $webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH) - Write-Host "Executing:" $python_path $GET_PIP_PATH - & $python_path $GET_PIP_PATH - } else { - Write-Host "pip already installed." - } -} - - -function DownloadMiniconda ($python_version, $platform_suffix) { - if ($python_version -eq "3.4") { - $filename = "Miniconda3-3.5.5-Windows-" + $platform_suffix + ".exe" - } else { - $filename = "Miniconda-3.5.5-Windows-" + $platform_suffix + ".exe" - } - $url = $MINICONDA_URL + $filename - $filepath = Download $filename $url - return $filepath -} - - -function InstallMiniconda ($python_version, $architecture, $python_home) { - Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home - if (Test-Path $python_home) { - Write-Host $python_home "already exists, skipping." - return $false - } - if ($architecture -eq "32") { - $platform_suffix = "x86" - } else { - $platform_suffix = "x86_64" - } - $filepath = DownloadMiniconda $python_version $platform_suffix - Write-Host "Installing" $filepath "to" $python_home - $install_log = $python_home + ".log" - $args = "/S /D=$python_home" - Write-Host $filepath $args - Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru - if (Test-Path $python_home) { - Write-Host "Python $python_version ($architecture) installation complete" - } else { - Write-Host "Failed to install Python in $python_home" - Get-Content -Path $install_log - Exit 1 - } -} - - -function InstallMinicondaPip ($python_home) { - $pip_path = $python_home + "\Scripts\pip.exe" - $conda_path = $python_home + "\Scripts\conda.exe" - if (-not(Test-Path $pip_path)) { - Write-Host "Installing pip..." - $args = "install --yes pip" - Write-Host $conda_path $args - Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru - } else { - Write-Host "pip already installed." - } -} - -function main () { - InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON - InstallPip $env:PYTHON -} - -main diff --git a/appveyor/run_with_env.cmd b/appveyor/run_with_env.cmd deleted file mode 100644 index 5da547c..0000000 --- a/appveyor/run_with_env.cmd +++ /dev/null @@ -1,88 +0,0 @@ -:: To build extensions for 64 bit Python 3, we need to configure environment -:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: -:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1) -:: -:: To build extensions for 64 bit Python 2, we need to configure environment -:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of: -:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0) -:: -:: 32 bit builds, and 64-bit builds for 3.5 and beyond, do not require specific -:: environment configurations. -:: -:: Note: this script needs to be run with the /E:ON and /V:ON flags for the -:: cmd interpreter, at least for (SDK v7.0) -:: -:: More details at: -:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows -:: http://stackoverflow.com/a/13751649/163740 -:: -:: Author: Olivier Grisel -:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ -:: -:: Notes about batch files for Python people: -:: -:: Quotes in values are literally part of the values: -:: SET FOO="bar" -:: FOO is now five characters long: " b a r " -:: If you don't want quotes, don't include them on the right-hand side. -:: -:: The CALL lines at the end of this file look redundant, but if you move them -:: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y -:: case, I don't know why. -@ECHO OFF - -SET COMMAND_TO_RUN=%* -SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows -SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf - -:: Extract the major and minor versions, and allow for the minor version to be -:: more than 9. This requires the version number to have two dots in it. -SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1% -IF "%PYTHON_VERSION:~3,1%" == "." ( - SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1% -) ELSE ( - SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,2% -) - -:: Based on the Python version, determine what SDK version to use, and whether -:: to set the SDK for 64-bit. -IF %MAJOR_PYTHON_VERSION% == 2 ( - SET WINDOWS_SDK_VERSION="v7.0" - SET SET_SDK_64=Y -) ELSE ( - IF %MAJOR_PYTHON_VERSION% == 3 ( - SET WINDOWS_SDK_VERSION="v7.1" - IF %MINOR_PYTHON_VERSION% LEQ 4 ( - SET SET_SDK_64=Y - ) ELSE ( - SET SET_SDK_64=N - IF EXIST "%WIN_WDK%" ( - :: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/ - REN "%WIN_WDK%" 0wdf - ) - ) - ) ELSE ( - ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" - EXIT 1 - ) -) - -IF %PYTHON_ARCH% == 64 ( - IF %SET_SDK_64% == Y ( - ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture - SET DISTUTILS_USE_SDK=1 - SET MSSdk=1 - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 - ) ELSE ( - ECHO Using default MSVC build environment for 64 bit architecture - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 - ) -) ELSE ( - ECHO Using default MSVC build environment for 32 bit architecture - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 -) From 1c6af36a66cdac3734aa003905e6b828be0e56e2 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:08:39 +0200 Subject: [PATCH 12/25] Add publish workflow. --- .../{test-push-master.yml => publish.yml} | 24 +++++++++++++++---- .github/workflows/test-push.yml | 4 +--- 2 files changed, 21 insertions(+), 7 deletions(-) rename .github/workflows/{test-push-master.yml => publish.yml} (50%) diff --git a/.github/workflows/test-push-master.yml b/.github/workflows/publish.yml similarity index 50% rename from .github/workflows/test-push-master.yml rename to .github/workflows/publish.yml index cbd7233..5890ad9 100644 --- a/.github/workflows/test-push-master.yml +++ b/.github/workflows/publish.yml @@ -1,12 +1,12 @@ name: Run tests on several python versions run-name: ${{ github.actor }} testing freesasa-python on: - push: - branches: master + release: + types: [published] jobs: Test: - runs-on: ubuntu-latest matrix: + os: [macos-latest, windows-latest] python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - name: "Check out code" @@ -21,6 +21,22 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - python setup.py install + pip install build - name: Run tests run: USE_CYTHON=1 python setup.py test + - name: Build package + run: python -m build + - name: Build MacOS wheel + run: python setup.py bdist_wheel + - name: Build sdist + # same source for all versions + if: + { + { matrix.os == 'ubuntu-latest' && matrix.python.version == '3.10' }, + } + run: python setup.py sdist + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/test-push.yml b/.github/workflows/test-push.yml index 6de06c2..e3b12f6 100644 --- a/.github/workflows/test-push.yml +++ b/.github/workflows/test-push.yml @@ -1,8 +1,6 @@ name: Run tests run-name: ${{ github.actor }} testing freesasa-python -on: - push: - branches-ignore: master +on: push jobs: Test: runs-on: ubuntu-latest From 6160c5a6ece8ff7ec7b6f1c7941bd7e392c0ccfc Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:10:10 +0200 Subject: [PATCH 13/25] Clean up. --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 0b8e1ad..4a8eecf 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # FreeSASA Python module -[![Appveyor build status](https://ci.appveyor.com/api/projects/status/nyo51pv2ufj2yhcj/branch/master?svg=true)](https://ci.appveyor.com/project/mittinatten/freesasa-python/branch/master) -[![Travis build status](https://travis-ci.com/freesasa/freesasa-python.svg?branch=master)](https://travis-ci.com/freesasa/freesasa-python) - The module provides Python bindings for the [FreeSASA C Library](https://github.com/mittinatten/freesasa). There are PyPi packages for Python 3.6+, on Linux, Mac OS X and Windows. And it can be built from source for 2.7+ (Or by downloading older PyPi packages). From 665ed9fd9092492ecc56d43b7fb28a83789a0634 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:10:38 +0200 Subject: [PATCH 14/25] Clean up. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a8eecf..db0ec86 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # FreeSASA Python module The module provides Python bindings for the [FreeSASA C Library](https://github.com/mittinatten/freesasa). -There are PyPi packages for Python 3.6+, on Linux, Mac OS X and Windows. +There are PyPi packages for Python 3.7+, on Linux, Mac OS X and Windows. And it can be built from source for 2.7+ (Or by downloading older PyPi packages). Documentation can be found at http://freesasa.github.io/python/. From da57f5b6d9f08afd3cfa4ca86ad869b943357d21 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:12:27 +0200 Subject: [PATCH 15/25] Test other OSes. --- .github/workflows/test-push.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-push.yml b/.github/workflows/test-push.yml index e3b12f6..c0422fa 100644 --- a/.github/workflows/test-push.yml +++ b/.github/workflows/test-push.yml @@ -3,7 +3,9 @@ run-name: ${{ github.actor }} testing freesasa-python on: push jobs: Test: - runs-on: ubuntu-latest + matrix: + os: [ubunut-latest, macos-latest, windows-latest] + #runs-on: ubuntu-latest steps: - name: "Check out code" uses: actions/checkout@v3 From 676ad4e07b261ba961732f0a38fac73767594505 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:15:13 +0200 Subject: [PATCH 16/25] Fix gha matrix syntax. --- .github/workflows/publish.yml | 7 ++++--- .github/workflows/test-push.yml | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5890ad9..4a10655 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,9 +5,10 @@ on: types: [published] jobs: Test: - matrix: - os: [macos-latest, windows-latest] - python-version: ["3.7", "3.8", "3.9", "3.10"] + strategy: + matrix: + os: [macos-latest, windows-latest] + python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - name: "Check out code" uses: actions/checkout@v3 diff --git a/.github/workflows/test-push.yml b/.github/workflows/test-push.yml index c0422fa..d235a3d 100644 --- a/.github/workflows/test-push.yml +++ b/.github/workflows/test-push.yml @@ -3,8 +3,9 @@ run-name: ${{ github.actor }} testing freesasa-python on: push jobs: Test: - matrix: - os: [ubunut-latest, macos-latest, windows-latest] + strategy: + matrix: + os: [ubunut-latest, macos-latest, windows-latest] #runs-on: ubuntu-latest steps: - name: "Check out code" From 6c5e91cb879cffde76534b2f6ce38dbdc7ef7e9b Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:16:16 +0200 Subject: [PATCH 17/25] More syntax fixes. --- .github/workflows/publish.yml | 1 + .github/workflows/test-push.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4a10655..4aef880 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,6 +9,7 @@ jobs: matrix: os: [macos-latest, windows-latest] python-version: ["3.7", "3.8", "3.9", "3.10"] + runs-on: ${{ matrix.os }} steps: - name: "Check out code" uses: actions/checkout@v3 diff --git a/.github/workflows/test-push.yml b/.github/workflows/test-push.yml index d235a3d..4111332 100644 --- a/.github/workflows/test-push.yml +++ b/.github/workflows/test-push.yml @@ -6,7 +6,7 @@ jobs: strategy: matrix: os: [ubunut-latest, macos-latest, windows-latest] - #runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} steps: - name: "Check out code" uses: actions/checkout@v3 From 4e830dcb8623c10269093096b4491a5837559928 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:22:24 +0200 Subject: [PATCH 18/25] Clean up. --- .github/workflows/publish.yml | 4 +++- .github/workflows/test-push.yml | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4aef880..7f6c055 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,7 +25,9 @@ jobs: pip install -r requirements.txt pip install build - name: Run tests - run: USE_CYTHON=1 python setup.py test + env: + USE_CYTHON: 1 + run: python setup.py test - name: Build package run: python -m build - name: Build MacOS wheel diff --git a/.github/workflows/test-push.yml b/.github/workflows/test-push.yml index 4111332..afbf99e 100644 --- a/.github/workflows/test-push.yml +++ b/.github/workflows/test-push.yml @@ -5,12 +5,11 @@ jobs: Test: strategy: matrix: - os: [ubunut-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - name: "Check out code" uses: actions/checkout@v3 - - name: "Get FreeSASA C library" run: git submodule update --init - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -23,4 +22,6 @@ jobs: pip install -r requirements.txt python setup.py install - name: Run tests - run: USE_CYTHON=1 python setup.py test + env: + USE_CYTHON: 1 + run: python setup.py test From 7b549da78d11a7e3ad0a03e21c38ed8b7e284508 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:27:50 +0200 Subject: [PATCH 19/25] Another attempt at USE_CYTHON for windows. --- .github/workflows/test-push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-push.yml b/.github/workflows/test-push.yml index afbf99e..461a8b9 100644 --- a/.github/workflows/test-push.yml +++ b/.github/workflows/test-push.yml @@ -3,6 +3,8 @@ run-name: ${{ github.actor }} testing freesasa-python on: push jobs: Test: + env: + USE_CYTHON: 1 strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] @@ -22,6 +24,4 @@ jobs: pip install -r requirements.txt python setup.py install - name: Run tests - env: - USE_CYTHON: 1 run: python setup.py test From 45a26257639ea4118db0b45cc3e06b02b851dad6 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:30:24 +0200 Subject: [PATCH 20/25] Clean up. --- .github/workflows/test-push.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-push.yml b/.github/workflows/test-push.yml index 461a8b9..24b43b0 100644 --- a/.github/workflows/test-push.yml +++ b/.github/workflows/test-push.yml @@ -12,6 +12,7 @@ jobs: steps: - name: "Check out code" uses: actions/checkout@v3 + - name: "Get git submodules" run: git submodule update --init - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 From c5ae1851f550f998e782de59208eeca95a906bc1 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:33:27 +0200 Subject: [PATCH 21/25] Revert to simpler version of push job. --- .github/workflows/publish.yml | 4 +++- .github/workflows/test-push.yml | 7 ++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7f6c055..aababd6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,6 +5,8 @@ on: types: [published] jobs: Test: + env: + USE_CYTHON: 1 strategy: matrix: os: [macos-latest, windows-latest] @@ -13,7 +15,7 @@ jobs: steps: - name: "Check out code" uses: actions/checkout@v3 - - name: "Get FreeSASA C library" + - name: "Get upstream C library" run: git submodule update --init - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 diff --git a/.github/workflows/test-push.yml b/.github/workflows/test-push.yml index 24b43b0..d1db597 100644 --- a/.github/workflows/test-push.yml +++ b/.github/workflows/test-push.yml @@ -5,14 +5,11 @@ jobs: Test: env: USE_CYTHON: 1 - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: "Check out code" uses: actions/checkout@v3 - - name: "Get git submodules" + - name: "Get upstream C library" run: git submodule update --init - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 From 013f0765778ba47dec3b81507f905742a96c0837 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:35:31 +0200 Subject: [PATCH 22/25] Clean up. --- .github/workflows/publish.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index aababd6..f52ea59 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -36,10 +36,7 @@ jobs: run: python setup.py bdist_wheel - name: Build sdist # same source for all versions - if: - { - { matrix.os == 'ubuntu-latest' && matrix.python.version == '3.10' }, - } + if: ${{ matrix.os == 'ubuntu-latest' && matrix.python.version == '3.10' }} run: python setup.py sdist - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 From f28825beffe5796ec133a89ae04a23f34251482a Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:37:16 +0200 Subject: [PATCH 23/25] Rename job. --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f52ea59..cc0ded9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,7 +4,7 @@ on: release: types: [published] jobs: - Test: + Publish: env: USE_CYTHON: 1 strategy: From 8ed7954a0725527961cb9bc0efb9bdb6fcfc1a23 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:38:21 +0200 Subject: [PATCH 24/25] Rename job. --- .github/workflows/publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cc0ded9..32872f2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Run tests on several python versions +name: Publish PyPi package for all platforms run-name: ${{ github.actor }} testing freesasa-python on: release: @@ -9,7 +9,7 @@ jobs: USE_CYTHON: 1 strategy: matrix: - os: [macos-latest, windows-latest] + os: [macos-latest, windows-latest, ubuntu-latest] python-version: ["3.7", "3.8", "3.9", "3.10"] runs-on: ${{ matrix.os }} steps: From 75e47148acf91df61000047a72319e87ae326208 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Thu, 6 Oct 2022 19:42:28 +0200 Subject: [PATCH 25/25] Up version to test CI. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 46261d7..57d63ca 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ setup( name='freesasa', - version= '2.2.0a3', + version= '2.2.0a4', description='Calculate solvent accessible surface areas of proteins', long_description=long_description, author='Simon Mitternacht',