This is an automated email from the ASF dual-hosted git repository.

agrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion-python.git


The following commit(s) were added to refs/heads/master by this push:
     new 8a3ce59  Introduce conda directory containing datafusion-dev.yaml 
conda enviro… (#124)
8a3ce59 is described below

commit 8a3ce59f2ddfb29400abc8fac89f266741591123
Author: Jeremy Dyer <jdy...@gmail.com>
AuthorDate: Wed Jan 18 15:46:26 2023 -0500

    Introduce conda directory containing datafusion-dev.yaml conda enviro… 
(#124)
    
    * Introduce conda directory containing datafusion-dev.yaml conda 
environment file, conda build files for building and publishing packages to 
anaconda.org as well as supporting documentation updates to README.md
    
    * Added notes for performing conda release
---
 README.md                              | 22 ++++++++++++++-
 conda/environments/datafusion-dev.yaml | 41 ++++++++++++++++++++++++++++
 conda/recipes/build.sh                 | 20 ++++++++++++++
 conda/recipes/meta.yaml                | 50 ++++++++++++++++++++++++++++++++++
 dev/release/README.md                  | 23 ++++++++++++++++
 5 files changed, 155 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 35186a9..3cd144b 100644
--- a/README.md
+++ b/README.md
@@ -149,12 +149,18 @@ assert result.column(0) == pyarrow.array([6.0])
 
 ## How to install (from pip)
 
+### Pip
 ```bash
 pip install datafusion
 # or
 python -m pip install datafusion
 ```
 
+### Conda
+```bash
+conda install -c conda-forge datafusion
+```
+
 You can verify the installation by running:
 
 ```python
@@ -163,11 +169,25 @@ You can verify the installation by running:
 '0.6.0'
 ```
 
+
 ## How to develop
 
 This assumes that you have rust and cargo installed. We use the workflow 
recommended by [pyo3](https://github.com/PyO3/pyo3) and 
[maturin](https://github.com/PyO3/maturin).
 
-Bootstrap:
+The Maturin tools used in this workflow can be installed either via Conda or 
Pip. Both approaches should offer the same experience. Multiple approaches are 
only offered to appease developer preference. Bootstrapping for both Conda and 
Pip are as follows.
+
+Bootstrap (Conda):
+
+```bash
+# fetch this repo
+git clone g...@github.com:apache/arrow-datafusion-python.git
+# create the conda environment for dev
+conda env create -f ./conda/environments/datafusion-dev.yaml -n datafusion-dev
+# activate the conda environment
+conda activate datafusion-dev
+```
+
+Bootstrap (Pip):
 
 ```bash
 # fetch this repo
diff --git a/conda/environments/datafusion-dev.yaml 
b/conda/environments/datafusion-dev.yaml
new file mode 100644
index 0000000..0e17e16
--- /dev/null
+++ b/conda/environments/datafusion-dev.yaml
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+channels:
+- conda-forge
+dependencies:
+- black
+- flake8
+- isort
+- maturin
+- mypy
+- numpy
+- pyarrow
+- pytest
+- toml
+- importlib_metadata
+- python>=3.7,<3.11
+# Packages useful for building distributions and releasing
+- mamba
+- conda-build
+- anaconda-client
+# Packages for documentation building
+- sphinx
+- pydata-sphinx-theme==0.8.0
+- myst-parser
+- jinja2
+name: datafusion-dev
diff --git a/conda/recipes/build.sh b/conda/recipes/build.sh
new file mode 100644
index 0000000..f10be35
--- /dev/null
+++ b/conda/recipes/build.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+maturin build -r
diff --git a/conda/recipes/meta.yaml b/conda/recipes/meta.yaml
new file mode 100644
index 0000000..cce614b
--- /dev/null
+++ b/conda/recipes/meta.yaml
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + 
environ.get('VERSION_SUFFIX', '') %}
+{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
+
+package:
+  name: datafusion
+  version: {{ version }}
+
+source:
+  git_url: ../..
+
+build:
+  noarch: python
+  number: 0
+
+requirements:
+  host:
+    - {{ compiler('rust') }}
+    - python
+    - setuptools
+    - maturin
+  run:
+    - python
+
+test:
+  imports:
+    - datafusion
+
+about:
+  home: https://arrow.apache.org/datafusion
+  license: Apache-2.0
+  license_family: APACHE
+  license_file: LICENSE.txt
+  summary: Apache Arrow DataFusion Python Bindings
diff --git a/dev/release/README.md b/dev/release/README.md
index fd77f75..00eb8bb 100644
--- a/dev/release/README.md
+++ b/dev/release/README.md
@@ -148,6 +148,29 @@ This will create a file named 
`dist/datafusion-0.7.0.tar.gz`. Upload this to tes
 python3 -m twine upload --repository testpypi dist/datafusion-0.7.0.tar.gz
 ```
 
+### Publish Python Artifacts to Anaconda
+
+Publishing artifacts to Anaconda is similar to PyPi. First, Download the 
source tarball created in the previous step and untar it.
+
+```bash
+# Assuming you have an existing conda environment named `datafusion-dev` if 
not see root README for instructions
+conda activate datafusion-dev
+conda build .
+```
+
+This will setup a virtual conda environment and build the artifacts inside of 
that virtual env. This step can take a few minutes as the entire build, host, 
and runtime environments are setup. Once complete a local filesystem path will 
be emitted for the location of the resulting package. Observe that path and 
copy to your clipboard.
+
+Ex: `/home/conda/envs/datafusion/conda-bld/linux-64/datafusion-0.7.0.tar.bz2`
+
+Now you are ready to publish this resulting package to anaconda.org. This can 
be accomplished in a few simple steps.
+
+```bash
+# First login to Anaconda with the datafusion credentials
+anaconda login
+# Upload the package
+anaconda upload 
/home/conda/envs/datafusion/conda-bld/linux-64/datafusion-0.7.0.tar.bz2
+```
+
 ### Send the Email
 
 Send the email to start the vote.

Reply via email to