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.

If I have Python-related files in my workspace, automatically activate the extension

See original GitHub issue

Goal - Lets not wait for the user to open a python file to activate the extension

If the user has some of the following files we could probably activate the extension without having to wait for the user to open a python file:

  • pip env files
  • poetry files
  • setup.py
  • setup.cfg?
  • tox.ini
  • pyproject.toml
  • pytest.ini
  • requirements.txt
  • test_requirements.txt
  • .pylintrc
  • .flake8
  • __init__.py
  • manage.py
  • src/__init__.py
  • tests/__init__.py
  • meta.yml
  • environment.yml
  • anaconda-project.yml
  • .pep8
  • .pycodestyle

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:21
  • Comments:46 (19 by maintainers)

github_iconTop GitHub Comments

4reactions
brettcannoncommented, Feb 24, 2021

Thanks to @soneji for the PR and everyone else in constructively participating in the discussion! This will be out in our March release.

4reactions
brettcannoncommented, Feb 18, 2021

One thing to be aware of is we used to get complaints about being overly liberal with launching the extension by folks who happen to have Python scripts in their e.g. C++ code base who do nothing more than generate test data by running Python, and so they only edit Python code every couple of months and not every time they open a workspace.

Without discussing it with the team 😉 , my guess is we can probably consider files that very clearly delineate that a project is primarily Python-based (e.g. pyproject.toml), but we can’t do it for just any file that someone using Python for any reason may have (e.g. configuration files for linters which you might have set up for that one Python file you have).

So I think that would suggest we could consider:

  • Pipfile
  • setup.py
  • requirements.txt
  • manage.py for Django
  • environment.yml for Anaconda (maybe; that file is not exclusive to Python, e.g. R projects use the same file for Anaconda so this might not work out)

We don’t need setup.cfg as that’s covered by setup.py and pyproject.toml (otherwise that file is useless). pyproject.toml also takes care of Poetry. And everything else doesn’t necessarily suggest the code base is oriented towards Python (e.g. SConstruct has the issue of being used by projects that are not necessarily Python-focused, and using Pylint just means you have some Python code).

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to start python extension automatically in a workspace?
py file, run a python - * command in the Ctrl+Shift+P command pallete, etc). This means that if I open up a terminal...
Read more >
how to configure my project to automatically activate Python ...
To activate Python extension in VSCode I must open a Python file. Can I activate it without opening a Python file?
Read more >
Settings Reference for Python - Visual Studio Code
Settings Reference for the Python extension in Visual Studio Code. ... By default, it only shows when there are Python related files open...
Read more >
How to “Dockerize” Your Python Applications
If you're seeking a blueprint for deploying Python apps within Docker containers, look no further!
Read more >
Manage workspaces in portal or Python SDK (v2) - Azure ...
If you don't have an Azure subscription, create a free account before you ... automatically create services needed by the workspace or use...
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