diff --git a/.circleci/config.yml b/.circleci/config.yml index 612552f4eac59..0d9e3ade08846 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ jobs: PANDAS_CI: "1" steps: - checkout - - run: ci/setup_env.sh + - run: .circleci/setup_env.sh - run: PATH=$HOME/miniconda3/envs/pandas-dev/bin:$HOME/miniconda3/condabin:$PATH ci/run_tests.sh workflows: diff --git a/ci/setup_env.sh b/.circleci/setup_env.sh similarity index 100% rename from ci/setup_env.sh rename to .circleci/setup_env.sh diff --git a/.github/actions/setup-conda/action.yml b/.github/actions/setup-conda/action.yml new file mode 100644 index 0000000000000..1c947ff244fb9 --- /dev/null +++ b/.github/actions/setup-conda/action.yml @@ -0,0 +1,27 @@ +name: Set up Conda environment +inputs: + environment-file: + description: Conda environment file to use. + default: environment.yml + pyarrow-version: + description: If set, overrides the PyArrow version in the Conda environment to the given string. + required: false +runs: + using: composite + steps: + - name: Set Arrow version in ${{ inputs.environment-file }} to ${{ inputs.pyarrow-version }} + run: | + grep -q ' - pyarrow' ${{ inputs.environment-file }} + sed -i"" -e "s/ - pyarrow/ - pyarrow=${{ inputs.pyarrow-version }}/" ${{ inputs.environment-file }} + cat ${{ inputs.environment-file }} + shell: bash + if: ${{ inputs.pyarrow-version }} + + - name: Install ${{ inputs.environment-file }} + uses: conda-incubator/setup-miniconda@v2 + with: + environment-file: ${{ inputs.environment-file }} + channel-priority: ${{ runner.os == 'macOS' && 'flexible' || 'strict' }} + channels: conda-forge + mamba-version: "0.23" + use-mamba: true diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml deleted file mode 100644 index c357f149f2c7f..0000000000000 --- a/.github/actions/setup/action.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Set up pandas -description: Runs all the setup steps required to have a built pandas ready to use -runs: - using: composite - steps: - - name: Setting conda path - run: echo "${HOME}/miniconda3/bin" >> $GITHUB_PATH - shell: bash -el {0} - - - name: Setup environment and build pandas - run: ci/setup_env.sh - shell: bash -el {0} diff --git a/.github/workflows/docbuild-and-upload.yml b/.github/workflows/docbuild-and-upload.yml index 8c2c86dc693a9..5ffd4135802bd 100644 --- a/.github/workflows/docbuild-and-upload.yml +++ b/.github/workflows/docbuild-and-upload.yml @@ -24,24 +24,27 @@ jobs: group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-web-docs cancel-in-progress: true + defaults: + run: + shell: bash -el {0} + steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Set up pandas - uses: ./.github/actions/setup + - name: Set up Conda + uses: ./.github/actions/setup-conda + + - name: Build Pandas + uses: ./.github/actions/build_pandas - name: Build website - run: | - source activate pandas-dev - python web/pandas_web.py web/pandas --target-path=web/build + run: python web/pandas_web.py web/pandas --target-path=web/build - name: Build documentation - run: | - source activate pandas-dev - doc/make.py --warnings-are-errors + run: doc/make.py --warnings-are-errors - name: Install ssh key run: | @@ -49,18 +52,18 @@ jobs: echo "${{ secrets.server_ssh_key }}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa echo "${{ secrets.server_ip }} ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBE1Kkopomm7FHG5enATf7SgnpICZ4W2bw+Ho+afqin+w7sMcrsa0je7sbztFAV8YchDkiBKnWTG4cRT+KZgZCaY=" > ~/.ssh/known_hosts - if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}} + if: github.event_name == 'push' && github.ref == 'refs/heads/main' - name: Copy cheatsheets into site directory run: cp doc/cheatsheet/Pandas_Cheat_Sheet* web/build/ - name: Upload web run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' web/build/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas - if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}} + if: github.event_name == 'push' && github.ref == 'refs/heads/main' - name: Upload dev docs run: rsync -az --delete doc/build/html/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas/pandas-docs/dev - if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}} + if: github.event_name == 'push' && github.ref == 'refs/heads/main' - name: Move docs into site directory run: mv doc/build/html web/build/docs diff --git a/.github/workflows/macos-windows.yml b/.github/workflows/macos-windows.yml index 560a421ec74ec..26e6c8699ca64 100644 --- a/.github/workflows/macos-windows.yml +++ b/.github/workflows/macos-windows.yml @@ -43,22 +43,11 @@ jobs: with: fetch-depth: 0 - - name: Install Dependencies - uses: conda-incubator/setup-miniconda@v2.1.1 + - name: Set up Conda + uses: ./.github/actions/setup-conda with: - mamba-version: "*" - channels: conda-forge - activate-environment: pandas-dev - channel-priority: ${{ matrix.os == 'macos-latest' && 'flexible' || 'strict' }} environment-file: ci/deps/${{ matrix.env_file }} - use-only-tar-bz2: true - - # ImportError: 2): Library not loaded: @rpath/libssl.1.1.dylib - # Referenced from: /Users/runner/miniconda3/envs/pandas-dev/lib/libthrift.0.13.0.dylib - # Reason: image not found - - name: Upgrade pyarrow on MacOS - run: conda install -n pandas-dev -c conda-forge --no-update-deps pyarrow=6 - if: ${{ matrix.os == 'macos-latest' }} + pyarrow-version: ${{ matrix.os == 'macos-latest' && '6' || '' }} - name: Build Pandas uses: ./.github/actions/build_pandas @@ -66,9 +55,6 @@ jobs: - name: Test run: ci/run_tests.sh - - name: Build Version - run: conda list - - name: Publish test results uses: actions/upload-artifact@v3 with: diff --git a/setup.py b/setup.py index 0418fe67c2f76..ced8b8dbc96c6 100755 --- a/setup.py +++ b/setup.py @@ -333,7 +333,7 @@ def run(self): extra_compile_args.append("/Z7") extra_link_args.append("/DEBUG") else: - # PANDAS_CI=1 is set by ci/setup_env.sh + # PANDAS_CI=1 is set in CI if os.environ.get("PANDAS_CI", "0") == "1": extra_compile_args.append("-Werror") if debugging_symbols_requested: