1 year ago

#136844

test-img

ScienceNoob

Installing conda package from local path works, but not from anaconda.org

I've built a package through conda-build. When I'm installing it through conda install --use-local PACKAGENAME it works perfectly. Afterwards, I'm uploading the package to anaconda.org through anaconda upload PATH. But when I'm trying to install the package from anaconda.org, it doesn't work. It installs without errors, but I can't import the package and I can't use the related CLI. What could be the reason for this?

Here is my meta.yaml, which I used to built the package:

{% set name = "packagename" %}
{% set version = "1.0.0" %}

package:
  name: "{{ name|lower }}"
  version: "{{ version }}"

source:
  url: "https://test.pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz"
  sha256: 32d605e578c30c4XXXXXXXX0f81030dd9396588752800a5e4f796f0

build:
  number: 0
  script: "{{ PYTHON }} -m pip install ."

requirements:
  host:
    - pip
    - python
    - requests >=2.5.0
  run:
    - python
    - requests >=2.5.0

test:
  imports:
    - packagename

about:
  home: "https://gitlab.com/lab/data-services/packagename"
  license: MIT
  license_family: MIT
  license_file: 
  summary: "A cool data access client"
  doc_url: 
  dev_url: 

And here my setup.py:

import os
from setuptools import setup

about = {}
with open(os.path.join("PACKAGENAME", "__version__.py")) as f:
    exec(f.read(), about)

with open("README.md", mode="r") as file:
    readme = file.read()

setup(
    name=about["__title__"],
    version=about["__version__"],
    description=about["__description__"],
    long_description=readme,
    long_description_content_type="text/markdown",
    author=about["__author__"],
    author_email=about["__author_email__"],
    url=about["__url__"],
    license=about["__license__"],
    classifiers=[
        "Development Status :: 3 - Alpha",
        "Intended Audience :: Developers",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: Implementation :: CPython",
        "Programming Language :: Python :: Implementation :: PyPy",
        "Operating System :: OS Independent",
    ],
    packages=["PACKAGENAME"],
    package_data={"PACKAGENAME": ["endpoints.ini"]},
    python_requires=">=3.7",
    install_requires=["requests>=2.5.0"],
    extras_require={
        "test": ["mypy", "pytest", "pytest-cov", "responses", "types-requests", "types-setuptools"]
    },
    scripts=[os.path.join("bin", "PACKAGENAME")],
)

python

anaconda

conda

conda-build

0 Answers

Your Answer

Accepted video resources