What I really want is a GPT who can set my dev env when I ask it to.
Hey ChatGPT, you give me the definitive commands that will install a good version of python, create a venv, install the right packages and command line tools, setup the configuration just right and let me just code?
Cause for the code, codepilot is already fantastic.
Here are the definitive commands that will install a good version of Python, create a virtual environment (venv), install the necessary packages and command line tools, set up the configuration correctly, and allow you to start coding:
Install a good version of Python:
# Install the latest version of Python 3
sudo apt update
sudo apt install python3
Create a virtual environment (venv) for your project:
# Create a virtual environment for your project
python3 -m venv my_project
# Activate the virtual environment
source my_project/bin/activate
Install the necessary packages and command line tools:
# Install the necessary packages and command line tools
pip install --upgrade pip
pip install setuptools wheel
pip install flake8 black isort
Set up the configuration for your project:
# Set up the configuration for your project
flake8 --install-hook git
black --install-hook git
isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-as --line-width 88 --recursive --thirdparty my_project
Start coding:
# Start coding in your project
cd my_project
nano my_project.py
This series of commands will install the latest version of Python 3, create a virtual environment for your project, install the necessary packages and command line tools, set up the configuration for your project, and allow you to start coding. I hope this helps. Let me know if you have any other questions.
There's good odds that if you responded "hey, I got an error about virtualenv being missing, what do I need to fix that?" it will suggest that. It's a genuine chat interface; if something isn't quite right, you can point that out and ask it to correct it, and it has good odds of understanding.
Did you try asking ChatGPT? This is its response to your verbatim question (and if it isn't exactly what you had in mind you can reply and ask it to change things, like do it on Windows or make it a script):
To install Python, you can use the following command:
$ sudo apt-get install python3
To create a virtual environment (venv) for your Python project, you can use the following command:
$ python3 -m venv /path/to/venv
To activate the virtual environment, you can use the following command:
$ source /path/to/venv/bin/activate
To install packages within the virtual environment, you can use the following command:
$ pip install <package-name>
To install command line tools, you can use the following command:
$ sudo apt-get install <tool-name>
To set up the configuration for your project, you will need to edit the appropriate configuration files for the tools and libraries that you are using. The specific steps for this will depend on the details of your project and the tools that you are using.
Once you have set up your environment and installed the necessary packages and tools, you can start coding!
This has a failure mode in each single line, even if we ignore it will not work on any OS that is not debian-like, which is most of them.
First line, you don't chose which Python you install, only the 3, so you don't know if the libs you need will be available, which syntax you can use and which stdlib is at your disposable.
Then, you use venv which may not be available because the first line you used doesn't install all python packages and in some debian/ubuntu versions they don't include venv, setuptools or pip in the python3 package.
Then you pip install packages, which may fail if this has a c extensions which is not a wheel (E.G: you do machine learning), because you didn't get the python headers in the previous commands.
Then you install command lines with apt-get, meaning your tool version may not be upgraded to match the python you used. For pylint and mypy, this means it at beast false positives, at worst crashes
Of course, none of that explains how to setup your IDE to use said virtual, setup things like databases, init the git repo or put good default in config files.
Don't get me wrong, it's a good start, and not worse than most tutorials I read online written by human.
I don't doubt that it will get better over time though, and I can't wait. Bootstrapping is a plague to teach people.
> if it isn't exactly what you had in mind you can reply and ask it to change things
A lot of the things you complain about were underspecified in your question, it has to make some assumptions. And I'll bet if you ran into any of the errors that you describe you could get solutions by simply pasting the errors into the chat box. The code produced by these models is not going to be perfect any more than a human's would be. You'll still need an iterative process and some common sense. But it's easier and faster than doing everything yourself.
I only know how to specify the questions because I know they are sources of problems since I can install an entire setup project from scratch on the top of my head.
Most can't though, and they won't ask specific questions.
But with time, GPT will likely be able to ask questions to get the context, and that will change everything.
I mean if you ask the same question to a human your question is ambiguous enough that you will get the same type of issues.
How is any being or AI meant to read your mind to know you don't want instructions for system X but assume the instructions would be good on system Y etc. I feel sorry for the humans you expect to query you to get what you really want out of you.
With this language model around it, I imagine that's a trivial next step. ChatGPT was correctly self-diagnosing problems when I pasted the error codes back in. It justs needs a setup where output is looped back in, and I imagine you could start to say things like:
Give me an environment where the test suite passes for this new repo I've cloned, based on all the environment config inside.
- Finds versions, sets them up
- Installs packages
- Asks about conflicts or problems
- Notes why the tests fail first time (no DB!)
- Creates the DB, runs migrations
- Notes why the tests fail next time (missing env variable)
- Finds a similar env variable in the example file, creates and local env file
- etc etc
That's all possible now if you paste the messages into GPT (with some errors, which repeated attempts can resolve), it needs connecting up into a self-aware environment.
Why do we still need to do all this boilerplate? I'm not even singling out Python here, I actually think that Codepilot being so amazing is kind of sad, clearly we shouldn't be needing to do all these things in 2022.
It's funny you ask this because I've been asking ChatGPT for exactly these sorts of issues. It misses sometimes, but I've gotten a couple of really good hits.
Hey ChatGPT, you give me the definitive commands that will install a good version of python, create a venv, install the right packages and command line tools, setup the configuration just right and let me just code?
Cause for the code, codepilot is already fantastic.