deta / deta-cli

Legacy Deta CLI. Repository is now archived.
https://deta.space
MIT License
67 stars 13 forks source link

remove anything after a semicolong to deal with pipenv requirement files #54

Closed boanergies closed 2 years ago

boanergies commented 3 years ago

This is a pull request to have the deta deploy accept requirements.txt files produced by pipenv

boanergies commented 3 years ago

Pipenv is a great tool for managing pythong applications.

Pipenv has the abillity to output requirments.txt files that deta deploy expects but they come out in a format like the example shows below:

#
# These requirements were autogenerated by pipenv
# To regenerate from the project's Pipfile, run:
#
#    pipenv lock --requirements
#

-i https://pypi.org/simple
aiofiles==0.7.0
certifi==2021.5.30
charset-normalizer==2.0.3; python_version >= '3'
deta==1.0.0
fastapi==0.66.1
idna==3.2; python_version >= '3'
jinja2==3.0.1
markupsafe==2.0.1; python_version >= '3.6'
pydantic==1.8.2; python_full_version >= '3.6.1'
requests==2.26.0
starlette==0.14.2; python_version >= '3.6'
typing-extensions==3.10.0.0
urllib3==1.26.6; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4.0'

The semicolons are not recognized by pip install -r and so when you run a deta deploy it fails. Up till now I've been hand editing my requirement files to work with deta deploy (which is fine since I don't commit the requirements files) but I thought it would be easier for automation purposes when a project is using Pipenv that deta already handles the format of requirement files produced by Pipenv.

Specifically the one line I added will keep everything before the semicolon producing the needed requirements file for pip install -r.

I tried to make a golang test to verify this but I've never worked in go so I was having a pretty rough time getting something to work. Sorry for the lack of tests! Let me know what you think!

boanergies commented 3 years ago

I just saw the merge request where tests are being added, I would be happy to add tests once that branch is merged in!

abdelhai commented 2 years ago

adding this to our next release todo list