-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrating the packaging system to poetry
with pyproject.toml
#409
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## next #409 +/- ##
=======================================
Coverage 90.07% 90.07%
=======================================
Files 2 2
Lines 262 262
=======================================
Hits 236 236
Misses 26 26 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, I had some problems running poetry install --with dev
.
Got the error "[Errno 2] No such file or directory: 'python'
". Seems to be an alias problem though, because I could fix the error running
sudo apt install python-is-python3
It seems like poetry doesn't support the python command being named "python3
". Maybe we can fix it using some specific poetry config during installation?
Also, for some reason, I had some problems running the tox's tests in python version 3.11. Here's the errors that I got:
======================================================================
FAIL: test_get_use_local_only (tests.test_pipreqs.TestPipreqs.test_get_use_local_only)
Test without checking PyPI, check to see if names of local
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/fernando/home/labxp/pipreqsxp/pipreqs/tests/test_pipreqs.py", line 142, in test_get_use_local_only
self.assertTrue(item["name"].lower() in self.local)
AssertionError: False is not true
======================================================================
FAIL: test_init (tests.test_pipreqs.TestPipreqs.test_init)
Test that all modules we will test upon are in requirements file
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/fernando/home/labxp/pipreqsxp/pipreqs/tests/test_pipreqs.py", line 169, in test_init
self.assertEqual(data, sorted(data))
AssertionError: Lists differ: ['ana[186 chars]s==3.1.0', 'pyflakes==3.0.1', 'requests==2.31.[36 chars]4.0'] != ['ana[186 chars]s==3.0.1', 'pyflakes==3.1.0', 'requests==2.31.[36 chars]4.0']
First differing element 9:
'pyflakes==3.1.0'
'pyflakes==3.0.1'
['analytics_python==1.4.post1',
'beautifulsoup4==4.12.2',
'boto==2.49.0',
'docopt==0.6.2',
'flask==2.2.2',
'flask_seasurf==1.1.1',
'ipython==8.12.0',
'nose==1.3.7',
'peewee==3.17.0',
+ 'pyflakes==3.0.1',
'pyflakes==3.1.0',
- 'pyflakes==3.0.1',
'requests==2.31.0',
'sqlalchemy==1.4.39',
'ujson==5.4.0']
======================================================================
FAIL: test_init_local_only (tests.test_pipreqs.TestPipreqs.test_init_local_only)
Test that items listed in requirements.text are the same
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/fernando/home/labxp/pipreqsxp/pipreqs/tests/test_pipreqs.py", line 195, in test_init_local_only
self.assertTrue(item[0].lower() in self.local)
AssertionError: False is not true
----------------------------------------------------------------------
For some odd reason, those errors only occur running python 3.11, but work on other python versions. Kinda odd because the tests ran in github actions seem to work successfully.
the correct name of the file with the python versions for pyenv is ".python-version" |
6eb555a
to
cf62146
Compare
I have run in my computer and the installation worked normally |
cf62146
to
68ee3d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @fredgrub and thank you very much @Fernando-crz and @mateuslatrova for your reviews!
I still haven' t tried to install it locally and test it, I have simply read the changes so I will be back later to let you know if anything goes wrong and if by any chance I can replicate the issue encountered by fernando
68ee3d7
to
6271ea7
Compare
problem installing in a fresh venv from the test repo:
|
could not replicate the issue encountered by fernando, |
@alan-barzilay, answering your comment #409 (comment), there is a peculiarity regarding using the test-pypi repo. Only pip install --extra-index-url https://pypi.org/simple -i https://test.pypi.org/simple/ pipreqs-build-test |
2cc93da
to
18f2032
Compare
- Deleted old setup files `requirements.txt`, `setup.cfg`, `setup.py`, `MANIFEST.in` - Added poetry files `poetry.toml`, `pyproject.toml`, `poetry.lock` - Added `.pyenv-version` and `.tool-versions` for `pyenv` and `asdf` - Updated `Makefile`, `CONTRIBUTING.rst`, `tox.ini`
18f2032
to
679004f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alan-barzilay, answering your comment #409 (comment), there is a peculiarity regarding using the test-pypi repo. Only pipreqs-build-test is available from test-pypi, the other dependencies such as yarg aren't guaranteed to be there. So we should explicitly make it fetch the main pypi repo. This is the command to do that
Great! I tried installing according to your instructions and everything worked as expected, I see no reason to not merge this. Thanks for all the hard work!
requirements.txt
,setup.cfg
,setup.py
,MANIFEST.in
poetry.toml
,pyproject.toml
,poetry.lock
.pyenv-version
and.tool-versions
forpyenv
andasdf
(useful for testing multiple python versions withtox
)Makefile
,CONTRIBUTING.rst
,tox.ini
I tested the upload to PyPI using TestPyPI. The package is located at https://test.pypi.org/project/pipreqs-build-test/ and can be installed via
pip
. I installed it as a user and it worked correctly.