question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Editable package command line interface installation under windows

See original GitHub issue
  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

Under Ubuntu I’m totally happy with my current setup. However under Windows I regularly run into issues w.r.t. this. I’m not sure if this is an issue or related to undocumented instructions.

On Windows 10 I’m running Python 3.8.6. My project.toml looks like follows:

[virtualenvs]
in-project = true

My setup.py looks like follows:

from setuptools import find_packages, setup

import my-package

setup(
   ...
   entry_points={"console_scripts": [my-cli=my_package.cli:main]},
   ...
)
...

The project structure looks as follows:

my-package
  .venv (contains virtual env)
  my_package (contains production code)
  setup.py
  poetry.toml
  ...

On windows if I install a new venv which implicitly installs the package in an editable manner via poetry install and without activating the venv (no execution of poetry shell) I can run python; >>>import my_package; >>>help(my_package) and get the expected help output. It seems like the package is installed into the system level Python installation instead of into the venv Python installation. If I try to run the CLI in the activated venv (poetry shell) my-cli --help the executable is not found. However if I try to run the CLI in the activated venv the CLI executable is not found as well.

What’s the recommended way to handle my setup under Windows properly?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
abncommented, Oct 13, 2020

You can refer to https://github.com/python-poetry/poetry-core/tree/master/tests/masonry/builders/fixtures/extended_with_no_setup for an example. Your build.py should be defined to handle building etc.

A real-world example is https://github.com/sdispater/pendulum/blob/master/build.py.

0reactions
fkromercommented, Oct 13, 2020

@abn I’ve tried on another windows machine with poetry run my-cli --help and got ImportError: C extension: tzutc not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first. . What to do here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows Configuration Designer command-line interface ...
You can use the Windows Configuration Designer command-line interface (CLI) to automate the building of provisioning packages.
Read more >
Windows Setup Command-Line Options | Microsoft Learn
The following command-line options are available for Windows Setup (setup.exe). Beginning with Windows 10, version 1607, ...
Read more >
Command line switches supported by Self-Extractor packages
Command -line switches supported by a software installation package, an update package, or a hotfix package created with Microsoft Self-Extractor.
Read more >
Edit a package using Package editor - MSIX | Microsoft Learn
From the welcome page of the MSIX Packaging Tool, select the Package editor icon, browse for your MSIX package and select Open package....
Read more >
How to install the ML.NET Command-Line Interface (CLI) tool
In this article · Pre-requisites · Install · Install a specific release version · Uninstall the CLI package · Update the CLI package...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found