Integrate oracle-bmcs-python-sdk in setup.py - python

I am installing dependencies of my package through setup.py file. If the package is not present in PyPI like oracle-bmcs-python-sdk , then how I can integrate it in my setup.py file. Currently we have public link of oracle bmc sdk:
https://docs.us-phoenix-1.oraclecloud.com/tools/ruby/latest/download/oracle-bmcs-ruby-sdk.zip
Now using only above link how can I install oraclebmc sdk from setup.py file ?
I have tried adding it in dependency_links but it doesn't work.

The BMCS Python SDK is now on PyPI, so adding it to your setup.py script should be the same as how you'd add any other Python package on PyPI.

Related

Use conan binary dependencies for Python wheel package

I have a C++ library project. This project is build by conan. Also I have a Python wrapper for the first project. The python project is built by setuptools.
How can setuptools pull the native library from conan repo to include in into the wheel (*.whl) file?
Or is it possible to make a wheel file using conan?
I've found this solution: https://blog.conan.io/2016/12/12/Conan-python-package-manager.html
But in this solution conan does not create a wheel file to distribute the package.

setup.py does not find package installed via conda

I'm developing my own conda package. I'm using a setup.py in the process of generating that package. When developing, it can be useful to conda install --no-deps package and ./setup.py develop in the repo. The install works, but setup.py errors out because it cannot satisfy a dependency. There is another package with the same name but to low version on pypi. However, the correct version of this dependency is already installed via conda. Why does it first try to install the package before checking if it is already installed? How can I make setup.py realize that nothing needs to be installed?
How is the package built?
I have this blt.bat:
"%PYTHON%" setup.py install --single-version-externally-managed --record=record.txt
if errorlevel 1 exit 1
and the dependencies listed in the meta.yaml. It falls to setup.py to define the package version (read from a .py file), define the entry points and the included non-Python files. It gets the dependencies by parsing the meta.yaml.
What is the error message?
This is the output of setup.py develop:
$ python setup.py develop
running develop
C:\ProgramData\Miniconda3\envs\my_env\lib\site-packages\setuptools\command\easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
C:\ProgramData\Miniconda3\envs\my_env\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running egg_info
writing my_package.egg-info\PKG-INFO
writing dependency_links to my_package.egg-info\dependency_links.txt
writing entry points to my_package.egg-info\entry_points.txt
writing requirements to my_package.egg-info\requires.txt
writing top-level names to my_package.egg-info\top_level.txt
reading manifest file 'my_package.egg-info\SOURCES.txt'
writing manifest file 'my_package.egg-info\SOURCES.txt'
running build_ext
Creating c:\programdata\miniconda3\envs\my_env\lib\site-packages\my_package.egg-link (link to .)
my_package 6.1.0 is already the active version in easy-install.pth
Installing entry_point0-script.py script to C:\ProgramData\Miniconda3\envs\my_env\Scripts
Installing entry_point0.exe script to C:\ProgramData\Miniconda3\envs\my_env\Scripts
Installing entry_point1-script.py script to C:\ProgramData\Miniconda3\envs\my_env\Scripts
Installing entry_point1.exe script to C:\ProgramData\Miniconda3\envs\my_env\Scripts
Installed c:\users\jpoppinga\my_git_repository
Processing dependencies for my_package==6.1.0
Searching for my_dep<13.1,>=13.0.1
Reading https://pypi.org/simple/my_dep/
C:\ProgramData\Miniconda3\envs\my_env\lib\site-packages\pkg_resources\__init__.py:123: PkgResourcesDeprecationWarning: is an invalid version and will not be supported in a future release
warnings.warn(
No local packages or working download links found for my_dep<13.1,>=13.0.1
error: Could not find suitable distribution for Requirement.parse('my_dep<13.1,>=13.0.1')

distribute python package without publishing it in PyPi [duplicate]

In order to stage python project within our corporation I need to make an installable distribution.
This should include:
An egg or whl for my project
An egg or whl for every dependency of the project
(optionally) produce a requirements.txt file listing all the installable components for this release
Is there an easy plug in, (e.g. an alternative to bdist_wheel) that will not only compile one wheel but also that project's components?
Obviously I can script this, but I was hoping that there might be a short-cut that builds the package + dependencies in fewer steps.
This needs to work on Python 2.7 on Windows + Linux.
You will need to create a setup.py file for your package. Make sure you have the latest setuptools and pip installed. Then run the following:
python setup.py bdist_wheel
This will create a wheel file for your package. This assumes you don't have C/C++ headers, DLLs, etc. If you do, then you'll probably have a lot more work to do.
To get dependencies, you will want to create a requirements.txt file and run the following:
pip wheel -r requirements.txt
If your package isn't on PyPI, then you'll have to manually copy your package's wheel file into the wheel folder that this command creates. For more information see the following excellent article:
http://lucumr.pocoo.org/2014/1/27/python-on-wheels/
With the latest pip and wheel, you can simply run
pip wheel .
within your project folder, even if your application isn't on PyPi. All wheels will be stored in the current directory (.).
To change the output directory (to for example, ./wheels), you may use the -w / --wheel-dir option:
pip wheel . -w wheels
All the options available are listed at the pip documentation.
With poetry you can define your dependencies and metadata about your project in a file in the root of your project, called pyproject.toml:
[tool.poetry]
name = "my-project"
version = "0.1.0"
description = "some longer description"
authors = ["Some Author <some#author.io>"]
[tool.poetry.dependencies]
python = "*"
[tool.poetry.dev-dependencies]
pytest = "^3.4"
To build your project as a wheel, execute poetry build
$ poetry build
Building my-project (0.1.0)
- Building sdist
- Built my-project-0.1.0.tar.gz
- Building wheel
- Built my-project-0.1.0-py3-none-any.whl
a dist/ folder is created with a wheel for your project.

in virtualenv, pip installing locally from source fails

I am trying to install a library in a virtualenv instance with pip. The library version I want (wxPython 3.0.2)
is not available on PyPi; it is only available for download from SourceForge. Thus, I have the source tarball downloaded on my machine and I am trying to install it in such a way that it will play nicely with virtualenv.
(I am on a Windows computer, running Python 2.7.)
I have tried the following:
doing a direct install: pip install wxPython-src-3.0.2.0.tar.bz2
extracting the files from the tarball to wxPython-src-3.0.2.0, then installing from the extracted directory: pip install wxPython-src-3.0.2.0
extracting the files from the tarball, then navigating into the extracted folder to the nested wxPython directory, which holds the setup.py file, and then installing from there: pip install wxPython
The last attempt seems the most promising, but I get the following traceback:
Processing \wxpython-src-3.0.2.0\wxpython
Complete output from command python setup.py egg_info:
Setuptools must be installed to build an egg
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\__MY_USERNAME__\appdata\local\temp\pip-req-build-q0pxlt\
This is also strange, because it suggests I don't have setuptools even though I can run pip list and see version 40.6.3 installed.
Any help appreciated.
Why not install a precompiled version? There are a lot of .exe files at SF. You probably need wxPython3.0-win64-3.0.2.0-py27.exe.
Also take a look at Christoph Gohlke's collection.
If you still insist on installing from sources please bear in mind that wxPython 3 is so old it predates pip. Forget about pip.
First, you need to install wxWidgets as wxPython is just a Python wrapper for wxWidgets C++ library. Extract wxPython-src-3.0.2.0.tar.bz2 and follow instructions in wxPython-src-3.0.2.0/docs/msw/install.txt.
After compiling and installing wxWidgets compile wxPython. See wxPython-src-3.0.2.0/wxPython/docs/BUILD.txt.
My eventual solution was the easy way out: installing my package (wxPython) locally as #phd suggested, and opting for local package access via either virtualenv --system-site-packages env or deleting the "no-global-site-packages.txt" file in an existing environment folder.
Not what I expected to do, but it works so no complaints.

Python project installation without internet connection

I need to install a python project on a machine without internet connection. During the creation of the deb package I downloaded all python requirements with pip download and I putted them into the deb.
When installing the deb on the machine I get errors from python packages not being found and I discovered that packages creating problems are the ones specified into the field setup_requires of setup.py files of the included packages.
For example the PyJWT package has setup_requires=['pytest-runner'] but pytest-runner is not downloaded by pip download and during the installation this gives error.
My question are:
is there a way of having pip downloading all dependencies (also those on setup_requires fields)?
Is this the correct workflow for creating a deb that has to be installed offline?

Categories

Resources