Custom Conda Package Metadata Not Being Pushed

372
3
10-02-2019 05:34 AM
RenéTénière
New Contributor II

I have a Python library I created that I have as a Conda package. Although I made sure to include all the metadata fields, when the package is installed on the system none of the details are available, i.e. description, home, etc.

The package install is successful, however, I would like for the user to see the metadata. I have tried inputting simple dummy values as well with no luck. The only values that seem to come across are the name (lafpy) and version (0.3.1).

Below is the code from my setup.py and meta.yaml files. I also included the resulting METADATA file in the dist-info folder that was created during the package installation.

# Setup.py
import setuptools, os
def read(fname😞
   
return open(os.path.join(os.path.dirname(__file__), fname)).read()

setuptools.setup(
   
name='lafpy',
   
version='0.3.1',
   
description='Lands and Forestry Python Library',
   
url='https://bitbucket.org/nsdnrforestry/lafpy.git',
   
author='René Ténière',
   
author_email='test@novascotia.ca',
   
#long_description='Test',
   
long_description=read('README.md'),
   
long_description_content_type="text/markdown",
   
license='Nova Scotia Department of Lands and Forestry',
   
keywords='lafpy lands forestry arcpy arcgis pro python',
   
packages=setuptools.find_packages(),
   
python_requires='>=3.4,<3.7',
   
install_requires=['pyodbc'],
   
data_files=[('lafpy_support', ['lafpy_support/source.gpx'])],
   
platforms=['win64', 'win32'],
   
zip_safe=True)
# meta.yaml
{% set data = load_setup_py_data() %}
package:
   name: lafpy
   # name: {{ data['name'] }}
   version: {{ data['version'] }}
source:
   git_url
: https://bitbucket.org/nsdnrforestry/lafpy.git
build
:
   skip: True # [py<34]
   
number: 0
   
script: pip install .
   
# script: python setup.py sdist install --single-version-externally-managed --record=record.txt
   
# preserve_egg_dir: True
requirements:
   
host:
      
- python 3.6.6
      
- setuptools 39.2.0 py36_0
   run
:
      
- python >=3.6,<3.7
      
{% for dep in data['install_requires'] %}
      
- {{ dep.lower() }}
      
{% endfor %}
about:
   
home: https://bitbucket.org/nsdnrforestry/lafpy
   
license: {{ data['license'] }}
   
# license: 'test_license'
   
license_file: LICENSE.txt
   description
: {{ data['description'] }}
   
# description: 'test_desc'
   
summary: {{ data['long_description'] }}
   
# summary: 'Lands and Forestry Python Library'
   
dev_url: {{ data['url'] }}
   
# dev_url: https://bitbucket.org/nsdnrforestry/lafpy
   
doc_source_url: https://bitbucket.org/nsdnrforestry/lafpy/README.md
# \envs\arcgispro-py3-clone\Lib\site-packages\lafpy-0.3.1.dist-info\METADATA Metadata-Version: 2.1
Name: lafpy
Version: 0.3.1
Summary: Lands and Forestry Python Library
Home-page: https://bitbucket.org/nsdnrforestry/lafpy
Author: René Ténière
Author-email: test@novascotia.ca
License: Nova Scotia Department of Lands and Forestry
Keywords: lafpy lands forestry arcpy arcgis pro python
Platform: win64
Platform: win32
Requires-Python: >=3.4,<3.7
Requires-Dist: pyodbc

The Lands and Forestry Python Library, herein referred to as lafpy, was created as a way to centralize the
entire Forestry Division Python code-base into a convenient distributable package. The library contains
modules for use mainly within the ArcGIS Pro Python 3x environment and should not be used with Python 2x.
For more information, please see the contact information below.

I have checked Anaconda Navigator and no metadata is populated. I have looked at the dist-info folder, and the metadata is filled in properly in the METADATA and License.txt files. What am I doing wrong?

I am assuming that this issue would have nothing to do with the fact that I am pulling the package from a custom Conda channel on a shared network drive?

Where does Anaconda Navigator pull the metadata from for the description?

I know that the description for the Python Package Manager comes from ..\envs\arcgispro-py3-clone\pkg-metadata\metadata.json and would like to know if there is a way to update that.

I need to distribute the package to my users, and I know that I may be a bit obsessive with the metadata since the install actually works, but it would be nice to do this properly.

Thanks,

René

3 Replies
ShaunWalbridge
Esri Regular Contributor

 René,

Great to see your work on packaging! Yes, you found the location for the Pro installation to manage its metadata for the backstage -- if you have a description / summary entry for your package, I can add it to that file, and it will be included in a later Pro release, or can be upgraded with `conda update` on the root environment. I'm not sure where Anaconda Navigator is pulling its metadata, I would expect it to be from one of two places: either the package metadata itself, or the information provided on Anaconda.org. For the package metadata itself, if you extract the package .tar.bz2, and look at info/recipe/meta.yaml, you'll see the final rendered output after the jinja templating is completed, that may provide clues if say a particular variable isn't pulling across a value. For the anaconda.org metadata, you can typically set this by visiting anaconda.org/<your username>/package/ and manually edit the description field there.

Cheers,

Shaun

RenéTénière
New Contributor II

Hi Shaun,

Thanks for the reply. I opened the meta.yaml file (below) and it looks fully populated. I can look into that some more using your other suggestion.

# This file created by conda-build 3.18.8
# meta.yaml template originally from:
# C:\src\GitLab\Lands_and_Forestry\Conda\conda\conda-packages\lafpy\conda.recipe, last modified Tue Nov  5 15:14:48 2019
# ------------------------------------------------

package:
    namelafpy
    version0.4.3
source:
    git_urlhttps://gitlab.novascotia.ca/lands-and-forestry/python/python3x/lafpy.git
build:
    number'0'
    stringpy36_0
requirements:
    build:
        - certifi 2019.9.11 py36_0
        - pip 19.3.1 py36_0
        - pyodbc 4.0.27 py36ha925a31_0
        - python 3.6.9 h5500b2f_0
        - setuptools 41.6.0 py36_0
        - sqlite 3.30.1 he774522_0
        - vc 14.1 h0510ff6_4
        - vs2015_runtime 14.16.27012 hf0eaf9b_0
        - wheel 0.33.6 py36_0
        - wincertstore 0.2 py36h7fe50ca_0
    run:
        - pyodbc
        - python >=3.6,<3.7.0a0
about:
    descriptionLands and Forestry Python Library
    homehttps://bitbucket.org/nsdnrforestry/lafpy
    license'GNS: Nova Scotia Department of Lands and Forestry'
    license_fileLICENSE
    summaryThe Lands and Forestry Python Library, herein referred to as lafpy, was
        created as a way to centralize the entire Forestry Division Python code-base
        into a convenient distributable package. The library contains modules for
        use mainly within the ArcGIS Pro Python 3x environment and should not be used
        with Python 2x.
extra:
    copy_test_source_filestrue
    finaltrue

As for the ArcGIS Pro side of things, when you say it can be upgraded with `conda update` on the root environment, what exactly do you mean? Are you saying that if I install lafpy to the root env it will show up properly in the Python Project Manager? Just want to make sure since everyone says to only make changes to the clone...

Thanks,

René

0 Kudos
RenéTénière
New Contributor II

I forgot to mention that I have lafpy on an internal government server channel. I do not upload the package to Anaconda.org, so I guess I am out of options there... I would have thought that Anaconda could deal with that?

0 Kudos