From 62e295f1cd154fbe688cb1b6607d8c2e127032fd Mon Sep 17 00:00:00 2001 From: zhengjiang shao Date: Fri, 15 May 2026 17:12:47 +0800 Subject: [PATCH 1/2] Replace Travis CI with GitHub Actions, fix outdated badges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Migrate CI from Travis CI (dead) to GitHub Actions - Test on Python 3.8, 3.9, 3.10, 3.11 - Remove dead landscape.io badge - Update Python badge: 2.7/3.5 → 3.8+ - Update PyPI badge: v0.8.12 → v0.9.0 - Update codecov badge format Co-Authored-By: deepseek-v4-pro --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ .travis.yml | 36 ------------------------------------ README.rst | 21 +++++++++------------ setup.py | 23 ++++++++++------------- 4 files changed, 47 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8da1fe9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10', '3.11'] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install numpy scipy matplotlib pyvista codecov + pip install -e . + - name: Run tests + run: coverage run -m vaspy.tests.test_all + - name: Upload coverage + run: codecov diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a87e90f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -language: python -python: - - "2.7" - - "3.5" - -notifications: - email: false - -install: - - sudo apt-get update - # We do this conditionally because it saves us some downloading if the - # version is the same. - - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then - wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh; - else - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - fi - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda update -q conda - # Useful for debugging any issues with conda - - conda info -a - - # Replace dep1 dep2 ... with your dependencies - - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION atlas numpy scipy matplotlib - - source activate test-environment - - python setup.py install # install vaspy - - pip install codecov - -# command to run tests -script: - - coverage run -m vaspy.tests.test_all - - codecov - diff --git a/README.rst b/README.rst index 46b9b0c..ae9138d 100644 --- a/README.rst +++ b/README.rst @@ -2,24 +2,21 @@ VASPy ===== -.. image:: https://travis-ci.org/PytLab/VASPy.svg?branch=master - :target: https://travis-ci.org/PytLab/VASPy +.. image:: https://github.com/PytLab/VASPy/actions/workflows/ci.yml/badge.svg + :target: https://github.com/PytLab/VASPy/actions :alt: Build Status -.. image:: https://landscape.io/github/PytLab/VASPy/master/landscape.svg?style=flat - :target: https://landscape.io/github/PytLab/VASPy/master - :alt: Code Health - .. image:: https://img.shields.io/codecov/c/github/PytLab/VASPy/master.svg :target: https://codecov.io/gh/PytLab/VASPy + :alt: Coverage -.. image:: https://img.shields.io/badge/python-3.5, 2.7-green.svg - :target: https://www.python.org/downloads/release/python-351/ - :alt: platform +.. image:: https://img.shields.io/badge/python-3.8+-green.svg + :target: https://www.python.org/downloads/ + :alt: Python -.. image:: https://img.shields.io/badge/pypi-v0.8.12-blue.svg - :target: https://pypi.python.org/pypi/vaspy/ - :alt: versions +.. image:: https://img.shields.io/badge/pypi-v0.9.0-blue.svg + :target: https://pypi.org/project/vaspy/ + :alt: PyPI Introduction ------------ diff --git a/setup.py b/setup.py index 8a0c420..0816234 100644 --- a/setup.py +++ b/setup.py @@ -15,24 +15,21 @@ VASPy ===== -.. image:: https://travis-ci.org/PytLab/VASPy.svg?branch=master - :target: https://travis-ci.org/PytLab/VASPy +.. image:: https://github.com/PytLab/VASPy/actions/workflows/ci.yml/badge.svg + :target: https://github.com/PytLab/VASPy/actions :alt: Build Status -.. image:: https://landscape.io/github/PytLab/VASPy/master/landscape.svg?style=flat - :target: https://landscape.io/github/PytLab/VASPy/master - :alt: Code Health - -.. image:: https://codecov.io/gh/PytLab/VASPy/branch/master/graph/badge.svg +.. image:: https://img.shields.io/codecov/c/github/PytLab/VASPy/master.svg :target: https://codecov.io/gh/PytLab/VASPy + :alt: Coverage -.. image:: https://img.shields.io/badge/python-3.5, 2.7-green.svg - :target: https://www.python.org/downloads/release/python-351/ - :alt: platform +.. image:: https://img.shields.io/badge/python-3.8+-green.svg + :target: https://www.python.org/downloads/ + :alt: Python -.. image:: https://img.shields.io/badge/pypi-v0.8.12-blue.svg - :target: https://pypi.python.org/pypi/vaspy/ - :alt: versions +.. image:: https://img.shields.io/badge/pypi-v0.9.0-blue.svg + :target: https://pypi.org/project/vaspy/ + :alt: PyPI Introduction From 674eeae1159feff0d34baa99d852bf156f842042 Mon Sep 17 00:00:00 2001 From: zhengjiang shao Date: Fri, 15 May 2026 17:16:21 +0800 Subject: [PATCH 2/2] Add PyPI auto-publish workflow on version tag push When a tag matching 'v*' is pushed, the workflow builds and publishes to PyPI automatically. Co-Authored-By: deepseek-v4-pro --- .github/workflows/publish.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1bce9f5 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,25 @@ +name: Publish to PyPI + +on: + push: + tags: + - 'v*' + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install build tools + run: pip install build twine + - name: Build package + run: python -m build + - name: Publish to PyPI + run: twine upload dist/* + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}