Skip to content
This repository was archived by the owner on Jun 12, 2023. It is now read-only.

Scripts for Windows host and update for new website #32

Merged
merged 12 commits into from
Jul 17, 2020
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ RUN apt-get update && \
RUN conda update conda -y \
&& conda install -y conda-build conda-verify gcc_linux-64 gxx_linux-64 \
&& conda clean --all

COPY pandas /pandas
Copy link
Member Author

Choose a reason for hiding this comment

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

I think not needed


4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@ wheels:


download-wheels:
./scripts/download_wheels.py $(PANDAS_VERSION)
python ./scripts/download_wheels.py $(PANDAS_VERSION)
# TODO: Fetch from https://www.lfd.uci.edu/~gohlke/pythonlibs/


upload-pypi:
twine upload pandas/dist/pandas-$(PANDAS_VERSION)*.{whl,tar.gz} --skip-existing

# twine upload pandas/dist/pandas-1.0.4*.{whl,tar.gz} --skip-existing
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Release automation for pandas.

Windows users should follow the steps in `windows.md`

## Steps to a release

- [ ] Manually update
Expand Down
21 changes: 21 additions & 0 deletions docker-files/windows/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM continuumio/miniconda3:latest

RUN apt-get update && apt-get install make && apt-get clean

RUN conda update conda -y

RUN git clone https://github.com/pandas-dev/pandas-release

RUN conda env update -n base --file=pandas-release/environment.yml

ARG GH_USERNAME

ENV GH_USERNAME=$GH_USERNAME

WORKDIR pandas-release

RUN make init-repos

RUN git config --global user.email "[email protected]"

RUN git config --global user.name "Pandas Development Team"
2 changes: 1 addition & 1 deletion scripts/pip_test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e

# Cytyhon is *not* required here.
# Cython is *not* required here.
conda create -n pip-test -y python=3.7 numpy pytz python-dateutil pytest pytest-mock hypothesis nomkl

source activate pip-test
Expand Down
200 changes: 200 additions & 0 deletions windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@


install Docker

ensure the following repositories are forked to your GitHub account
- https://github.com/pandas-dev/pandas-website
- https://github.com/conda-forge/pandas-feedstock
- https://github.com/MacPython/pandas-wheels
- https://github.com/pandas-dev/pandas


Open an Anaconda Prompt
TODO: resolve git bash Docker volume issues so that make can be used on host


build a Docker image with the conda base environment configured and repositories initialized.

change GH_USERNAME to your Github username

```
docker build -t pandas-release --build-arg GH_USERNAME=simonjayhawkins -f docker-files/windows/Dockerfile .
```

next we will prepare a Docker container for interactive use during the release process and copy the repositories
from the Docker image into a Docker volume for building the distribution and testing.

to start with a clean volume (after a previous release)

```
docker volume rm pandas-release
```

change TAG to the release version

```
docker run -it --env TAG=v1.0.5 --name=pandas-release -v pandas-release:/pandas-release pandas-release /bin/bash
```

the Docker release container should be now be running

make sure the repos are up-to-date
TODO: also make sure conda environment is up-to-date and pandas-release repo is up-to-date if
re-using an older Docker image

```
make update-repos
```

Tag the release (This doesn't push the tag)

```
make tag
```

stop the container
```
exit
```

create the Docker image for the sdist build, pip test and conda test containers
TODO: maybe update the image with apt-get for cached build

```
docker build -t pandas-build .
```

build the sdist

TODO: some of the next steps are repetative. set WORKDIR and symlink to /pandas in pandas-build Docker image instead
TODO: add container name (as in Makefile) and do not destroy container on exit

```
docker run -it --rm -v pandas-release:/pandas-release pandas-build /bin/bash

ln -s pandas-release/pandas pandas

cd pandas-release/

./scripts/build_sdist.sh

exit
```

pip tests

TODO: avoid need to pass explicit filename below
TODO: add container name (as in Makefile) and do not destroy container on exit

```
docker run -it --rm -v pandas-release:/pandas-release pandas-build /bin/bash

ln -s pandas-release/pandas pandas

cd pandas-release/

./scripts/pip_test.sh /pandas/dist/pandas-1.0.5.tar.gz

exit

```

conda tests

TODO: add container name (as in Makefile) and do not destroy container on exit
TODO: avoid need to re-type version below

```
docker run -it --rm --env PANDAS_VERSION=1.0.5 -v pandas-release:/pandas-release pandas-build /bin/bash

ln -s pandas-release/pandas pandas

cd pandas-release/

conda build --numpy=1.17.3 --python=3.8 ./recipe --output-folder=/pandas/dist

exit

```

copy the sdist file from the Docker volume to the local host
TODO: avoid need to enter specific filename below (maybe just copy contents of dist directory instead)

```
docker run -t --rm -v %cd%:/local -v pandas-release:/pandas-release pandas-release /bin/bash -c "cp /pandas-release/pandas/dist/pandas-1.0.5.tar.gz /local/"
```

Push the tag. No going back now.

restart the release container

```
docker start pandas-release -i

...

On pandas you should also now create and tag a new branch, so

...
```

Now manually create a release https://github.com/pandas-dev/pandas/releases

Make sure to upload the sdist as the "binary". Conda-forge uses it.


Start the binary builds.

restart the release container

```
docker start pandas-release -i

make conda-forge

make wheels

exit
```

Open PRs for each of those.

Note that `make wheels` actually pushes a job to MacPython to produce wheels which we will download later.


Docs. You can cheat and re-tag / rebuild these if needed.

<!-- doc:
docker run -it \
--name=pandas-docs \
-v ${CURDIR}/pandas:/pandas \
-v ${CURDIR}/scripts/build-docs.sh:/build-docs.sh \
pandas-docs \
/build-docs.sh -->

TODO build an intermediate doc image (and why pandas conda env not in Docker image?)
```
docker run -it --name=pandas-docs -v pandas-release:/pandas-release pandas-docs /bin/bash

rm -r pandas

ln -s pandas-release/pandas pandas

cd pandas-release/

# following maybe necessary to prevent segfaults
conda update -n base -c defaults conda

conda env create --file=/pandas/environment.yml --name=pandas

./scripts/build-docs.sh

exit
```

copy the built doc files to host and manually inspect html and pdf docs.

```
docker run -it --rm -v %cd%:/local -v pandas-release:/pandas-release pandas-release /bin/bash -c "cp -r /pandas-release/pandas/doc/build/ /local/pandas-docs"
```