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

chore(publish): anaconda #84

Merged
merged 39 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d4348cc
chore(publish): anaconda
gdulafactset May 10, 2024
98235b7
chore: try fixing error
gdulafactset May 20, 2024
0ec2e84
Merge branch 'main' into chore/publish/anaconda
gdulafactset Jun 18, 2024
2cc5f4b
chore: test conda build process
gdulafactset Jun 18, 2024
17b020a
chore: modify meta.yaml
gdulafactset Jun 19, 2024
91244ad
chore: try debugging
gdulafactset Jun 19, 2024
9b3f3b9
chore: fix sed command for ubuntu machine
gdulafactset Jun 19, 2024
b260910
chore: test if tag name is retrieved correctly
gdulafactset Jun 20, 2024
647f611
chore: add clearer marker
gdulafactset Jun 20, 2024
c4963cd
chore: checks if package exists otherwise waits
gdulafactset Jun 20, 2024
7f986da
chore: test waiting looping
gdulafactset Jun 20, 2024
32d9d32
chore: max retry mechanism
gdulafactset Jun 20, 2024
666a94d
chore: exponential sleep time
gdulafactset Jun 20, 2024
39efdb3
chore: moved conda build logic within loop
gdulafactset Jun 20, 2024
331cef5
chore: use real tag_name + script comments
gdulafactset Jun 20, 2024
a5384d6
chore: fix version extracted from tag
gdulafactset Jun 21, 2024
90c9695
chore: add version to echo + try hardcoded version
gdulafactset Jun 28, 2024
c3ac0d3
chore: further testing
gdulafactset Jun 28, 2024
8cdb1d7
chore: fix env reference
gdulafactset Jun 28, 2024
9034ac9
chore: capturing package path
gdulafactset Jun 28, 2024
c3662ce
chore: publish command to publish 0.9.0
gdulafactset Jul 1, 2024
3497f92
chore: check paths
gdulafactset Jul 1, 2024
3cc3aed
chore: more testing of paths
gdulafactset Jul 1, 2024
75c2c5c
chore: try running build command separately
gdulafactset Jul 1, 2024
f3eaa82
chore: try different folder
gdulafactset Jul 1, 2024
4057265
chore: test out all paths
gdulafactset Jul 1, 2024
899e89e
chore: try build without output flag
gdulafactset Jul 1, 2024
79f1176
chore: cleanup build/publish command
gdulafactset Jul 1, 2024
0bc1df1
chore: fix syntax error
gdulafactset Jul 1, 2024
b29b60d
chore: description + dev_url to conda package
gdulafactset Jul 1, 2024
cd81ffb
chore: remove tabbing
gdulafactset Jul 1, 2024
7406d8c
chore: try fixing the tabbing
gdulafactset Jul 1, 2024
ba1966f
chore: publishing v0.10.0 to try out new properties
gdulafactset Jul 1, 2024
d109b86
chore: remove pypi check
gdulafactset Jul 1, 2024
c1d037f
chore: test out force flag
gdulafactset Jul 1, 2024
750d494
chore: publishing 2.0.0 to anaconda
gdulafactset Jul 1, 2024
b605d1a
chore: set channel priority to try fix build issue
gdulafactset Jul 2, 2024
3e96d39
chore: cleanup workflow
gdulafactset Jul 2, 2024
e7de356
docs: update README with conda info
gdulafactset Jul 2, 2024
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
64 changes: 63 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ jobs:
name: Deploy to package index
runs-on: ubuntu-20.04
env:
PYTHON_VERSION: 3.9
REPOSITORY_USERNAME: ${{ secrets.PYPI_USERNAME }}
REPOSITORY_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
REPOSITORY_URL: ${{ secrets.PYPI_PUBLISH_URL }}
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
CONDA_ENV_NAME: conda-env

steps:
- name: Checkout repository
Expand All @@ -20,7 +23,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: ${{ env.PYTHON_VERSION }}

- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: ${{ env.CONDA_ENV_NAME }}
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Poetry
uses: snok/install-poetry@v1
Expand All @@ -37,3 +47,55 @@ jobs:
- name: Publish
run: |
poetry publish -r publish

- name: Publish to Anaconda
shell: bash -el {0}
run: |
conda install grayskull conda-build anaconda-client
conda info
conda list
grayskull --version
anaconda --version

count=0
max_retries=5
tag=${{ github.event.release.tag_name }}
version=${tag#v}
while [ $count -lt $max_retries ]; do
# Create meta.yaml recipe for the package pulled from PyPi
grayskull pypi fds.sdk.utils==${version}

if [ -f ./fds.sdk.utils/meta.yaml ]; then
echo "Version ${version} of fds.sdk.utils is available on PyPI."

# Modify the meta.yaml recipe-maintainers property to include all maintainers of this repo
sed -i "/recipe-maintainers:/,/extra:/ s/- .*/- gdulafactset/" fds.sdk.utils/meta.yaml
echo " - mima0815" >> fds.sdk.utils/meta.yaml
echo " - eschmidtfds" >> fds.sdk.utils/meta.yaml
echo " - Filip1x9" >> fds.sdk.utils/meta.yaml
echo " - dgawande12" >> fds.sdk.utils/meta.yaml

# Modify meta.yaml to include description and dev_url
sed -i "/about:/a \\
dev_url: \"https://github.com/factset/enterprise-sdk-utils-python\"\\
description: \"This repository contains a collection of utilities that supports FactSet's SDK in Python and facilitate usage of FactSet APIs.\"
" "fds.sdk.utils/meta.yaml"

# Build conda package
conda config --set anaconda_upload no
package_file=$(conda build fds.sdk.utils --output)
conda build -c conda-forge fds.sdk.utils

anaconda -t $ANACONDA_TOKEN upload -u factset -l main ${package_file}
break
else
echo "Version ${version} not found, rechecking in $((2 ** count)) seconds..."
sleep $((2 ** count))
count=$((count + 1))
fi
done

if [ $count -eq $max_retries ]; then
echo "Maximum retries reached, package with that version was not found, publish failed."
exit 1
fi
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# FactSet SDK Utilities for Python

[![PyPi](https://img.shields.io/pypi/v/fds.sdk.utils)](https://pypi.org/project/fds.sdk.utils/)
[![Anaconda-Server Badge](https://anaconda.org/factset/fds.sdk.utils/badges/version.svg)](https://anaconda.org/factset/fds.sdk.utils)
[![Apache-2 license](https://img.shields.io/badge/license-Apache2-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0)

This repository contains a collection of utilities that supports FactSet's SDK in Python and facilitate usage of FactSet
Expand All @@ -22,6 +23,12 @@ poetry add fds.sdk.utils
pip install fds.sdk.utils
```

### Conda

```sh
conda install factset::fds.sdk.utils
```

## Usage

This library contains multiple modules, sample usage of each module is below.
Expand Down
Loading