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

Github action for release #36704

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
135 changes: 135 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: Release Readiness

on:
workflow_dispatch:
inputs:
version:
description: 'The pandas version to release.'
default: '1.1.3'
required: true
# push-tag:
# description: 'Push tag on success?'
# default: 'false'
# required: true
Comment on lines +10 to +13
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wip

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once we have a tag we have a trigger for release


jobs:
build-sdist:
name: Build the sdist and maybe push the tag
runs-on: ubuntu-latest
env:
TAG: v${{ github.event.inputs.version }}
steps:
- name: Setting git user to Pandas Development Team
run: |
git config --global user.email "[email protected]"
git config --global user.name "Pandas Development Team"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install packaging
- name: Checkout pandas
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Tag the release. (This doesn't push the tag)
run: |
python ./scripts/tag.py $TAG
git log -n 5
- name: Update for build environment
run: |
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get clean
- name: Setting conda path
run: echo ::add-path::$CONDA/bin
- name: Update conda
run: |
conda config --set quiet true --set always_yes true
conda update -n base -c defaults conda
conda list
- name: Update conda environment for build process
run: |
conda install -y cython
conda clean --all
conda list
- name: build the sdist
run: |
rm -rf dist
git clean -xfd
python setup.py clean --quiet
python setup.py sdist --formats=gztar --quiet
- name: Store sdist archive as artifact
uses: actions/upload-artifact@v2
with:
name: pandas-${{ github.event.inputs.version }}.tar.gz
path: dist/pandas-${{ github.event.inputs.version }}.tar.gz
if-no-files-found: error

pip-test:
name: Pip Test
needs: build-sdist
runs-on: ubuntu-latest
steps:
- name: Setting conda path
run: echo ::add-path::$CONDA/bin
- name: Update conda
run: |
conda config --set quiet true --set always_yes true
conda update -n base -c defaults conda
conda list
- name: Create conda environment
run: |
conda create -n pip-test -y python=3.7 numpy pytz python-dateutil pytest pytest-mock hypothesis nomkl
conda clean --all
conda list
- name: get sdist from artifacts
uses: actions/download-artifact@v2
with:
name: pandas-${{ github.event.inputs.version }}.tar.gz
path: pandas/dist/
- name: Create wheel
run: |
source activate pip-test
python -m pip wheel --no-deps --wheel-dir=pandas/dist pandas/dist/pandas-${{ github.event.inputs.version }}.tar.gz
- name: Install pandas
run: |
source activate pip-test
python -m pip install --no-deps --no-index --find-links=pandas/dist --only-binary=pandas pandas
conda list
- name: Test
# test_missing_required_dependencies: https://github.com/pandas-dev/pandas/issues/33999
run: |
source activate pip-test
python -c "import pandas; pandas.test(extra_args=['-m not clipboard', '--skip-slow', '--skip-network', '--skip-db', '-k not test_missing_required_dependency'])"

conda-test:
name: Conda Test
needs: build-sdist
runs-on: ubuntu-latest
env:
PANDAS_VERSION: ${{ github.event.inputs.version }}
steps:
- name: Setting conda path
run: echo ::add-path::$CONDA/bin
- name: Update conda
run: |
conda config --set quiet true --set always_yes true
conda update -n base -c defaults conda
conda list
- name: Create conda environment
run: |
conda create -n conda-build -y conda-build conda-verify gcc_linux-64 gxx_linux-64
conda clean --all
conda list
- name: Checkout pandas
uses: actions/checkout@v2
- name: get sdist from artifacts
uses: actions/download-artifact@v2
with:
name: pandas-${{ github.event.inputs.version }}.tar.gz
path: dist/
- name: Conda Build and Test
run: |
source activate conda-build
conda build --numpy=1.17.3 --python=3.8 ./recipe --output-folder=dist

2 changes: 0 additions & 2 deletions conda.recipe/bld.bat

This file was deleted.

2 changes: 0 additions & 2 deletions conda.recipe/build.sh

This file was deleted.

40 changes: 0 additions & 40 deletions conda.recipe/meta.yaml

This file was deleted.

51 changes: 51 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{% set version = environ.get("PANDAS_VERSION") %}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from pandas-release and deleted the current recipe in pandas (may still want to retain existing though as builds from source instead of sdist)


package:
name: pandas
version: {{ version }}

source:
url: ../dist/pandas-{{ version }}.tar.gz
Copy link
Member Author

@simonjayhawkins simonjayhawkins Sep 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line changed otherwise copy and paste


build:
number: 0
script: python -m pip install --no-deps --ignore-installed .

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
host:
- python
- pip
- cython >=0.29.13
- numpy
run:
- python
- {{ pin_compatible('numpy') }}
- python-dateutil >=2.6.1
- pytz >=2017.2

test:
requires:
- pytest
- pytest-mock
- hypothesis
commands:
# test_missing_required_dependencies: https://github.com/pandas-dev/pandas/issues/33999
- python -c "import pandas; pandas.test(extra_args=['-m not clipboard', '--skip-slow', '--skip-network', '--skip-db', '-k not test_missing_required_dependency'])"

about:
home: http://pandas.pydata.org
license: BSD 3-clause
license_file: LICENSE
summary: 'High-performance, easy-to-use data structures and data analysis tools.'

extra:
recipe-maintainers:
- jreback
- jorisvandenbossche
- msarahan
- ocefpaf
- TomAugspurger
- WillAyd
63 changes: 63 additions & 0 deletions scripts/tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env python3
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this script from pandas-release.

if we want to trigger actions probably better to have in same repo.

"""
Tag a pandas release.

This does not push the tag.
"""
import argparse
import subprocess
import sys

from packaging import version


def check_tag(tag):
assert tag.startswith("v"), "Invalid tag '{}', must " "start with 'v'".format(tag)
ver = version.parse(tag.lstrip("v"))
assert isinstance(ver, version.Version), "Invalid tag '{}'".format(tag)
if "rc" in tag:
assert ".rc" not in tag, "RC tags should be formatted like '.0rcX' "
return tag


def checkout(tag):
if tag[-1] == "0" or "rc" in tag:
# off master
base = "master"
else:
base = ".".join([tag[1:].rsplit(".", 1)[0], "x"])

subprocess.check_call(["git", "checkout", base])
# subprocess.check_call(["git", "pull", "--ff-only", "upstream", base])


def commit(tag):
subprocess.check_call(["git", "clean", "-xdf"])
print("Creating tag {}".format(tag))
subprocess.check_call(
[
"git",
"commit",
"--allow-empty",
"-m",
"RLS: {}".format(tag[1:]),
]
)
subprocess.check_call(["git", "tag", "-a", tag, "-m", "Version {}".format(tag[1:])])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moreless copy and paste. deleted sync with upstream as working with origin



def parse_args(args=None):
parser = argparse.ArgumentParser(__name__, usage=__doc__)
parser.add_argument("tag", type=check_tag)

return parser.parse_args(args)


def main(args=None):
args = parse_args(args)
checkout(args.tag)
commit(args.tag)


if __name__ == "__main__":
sys.exit(main())