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

Feature/make conda installable #288

Merged
merged 2 commits into from Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 14 additions & 11 deletions build_conda_package.sh
@@ -1,12 +1,15 @@
mkdir channel
mkdir channel/linux-64
mkdir channel/linux-32
mkdir channel/osx-64/
mkdir channel/win-64/
mkdir channel/win-32
cp dist/* channel/linux-64/
cp dist/* channel/linux-32/
cp dist/* channel/osx-64/
cp dist/* channel/win-64/
cp dist/* channel/win-32/
# mkdir channel
# mkdir channel/linux-64
# mkdir channel/linux-32
# mkdir channel/osx-64/
# mkdir channel/win-64/
# mkdir channel/win-32
# cp dist/* channel/linux-64/
# cp dist/* channel/linux-32/
# cp dist/* channel/osx-64/
# cp dist/* channel/win-64/
# cp dist/* channel/win-32/

# conda convert ~/miniconda/conda-bld/osx-64/cookiecutter-0.9.1_BUILDNUM.tar.bz2 -p all
conda convert /Users/jacky.wong/opt/anaconda3/conda-bld/osx-64/relevanceai-0.28.0-py39_0.tar.bz2 -p all channel

16 changes: 8 additions & 8 deletions meta.yaml
@@ -1,14 +1,12 @@
{% set name = "RelevanceAI" %}
{% set version = "0.22.0" %}
{% set data = load_setup_py_data() %}

package:
name: "{{ name|lower }}"
version: "{{ version }}"
version: {{ data.get("version") }}

source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: 03eeed2bc2366ecfe36a29248a7c149e34cb409fe111a43d259c09dea0d37816

path: .

build:
number: 0
Expand All @@ -19,11 +17,13 @@ requirements:
- pip
- python
run:
- python
{% for req in data.get("install_requires", []) %}
- {{ req }}
{% endfor %}

about:
home: https://relevance.ai
license: BSD
license_family: BSD
license: Apache2.0
license_family: Apache
summary: Experimentation first vector database

44 changes: 44 additions & 0 deletions scripts/upload_to_conda.py
@@ -0,0 +1,44 @@
"""
script to upload to conda :)
Should be run from root of directory
Requirements:
- Install anaconda
- `conda install conda==4.10.3` (newer versions are broken)
- Run `conda install anaconda`
- `anaconda login`
- `conda build . -u relevance`
Then from the output, use this:
- conda convert /Users/jacky.wong/opt/anaconda3/conda-bld/osx-64/relevanceai-0.28.0-py39_0.tar.bz2 -p all -o channel
- conda config --add channels relevance
- conda config --add channels conda-forge
"""

import os
from pathlib import Path
from tqdm.auto import tqdm

# os.system("conda build .")
# TODO:
# anaconda upload \
# /Users/jacky.wong/opt/anaconda3/conda-bld/osx-64/relevanceai-0.28.0-0.tar.bz2
# anaconda_upload is not set. Not uploading wheels: []
# Automate the above

import subprocess

proc = subprocess.Popen(["conda", "build ."], stdout=subprocess.PIPE, shell=True)
(out, err) = proc.communicate()


# from observing the outputs, these seem to be the main file formats

files_to_upload = (
list(Path("channel").rglob("*.whl"))
+ list(Path("channel").rglob("*tar.gz"))
+ list(Path("channel").rglob("*.bz2"))
)
for fn in tqdm(files_to_upload):
print(fn)
cmd = f"anaconda upload --force -u relevance {fn}"
print(cmd)
os.system(cmd)