Skip to content
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

Cant Find 'requirements.txt' #2

Open
cgbsu opened this issue Mar 29, 2021 · 3 comments
Open

Cant Find 'requirements.txt' #2

cgbsu opened this issue Mar 29, 2021 · 3 comments

Comments

@cgbsu
Copy link

cgbsu commented Mar 29, 2021

I have been trying run this but it cant seem to find requirements.txt, I have tried manually specifying it, but, no dice. Its just a plain text file sitting in my repo's root. I tried using alpine but it wouldn't even start.

WARNING: The directory '/github/home/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
WARNING: You are using pip version 19.2.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

I have tried not specifying the deps_list and a bunch of other tweaks

name: Lint And Unit Tests

on: [push]

jobs:
  linter:
    runs-on: ubuntu-latest
    steps:
    - name: GitHub Action for pylint
      # You may pin to the exact commit or the version.
      # uses: cclauss/GitHub-Action-for-pylint@8ef4d22e119fb1cdc0f58f2e95cb1f8d8b0d55e6
      uses: cclauss/GitHub-Action-for-pylint@0.7.0
  unit_tests:
    runs-on: ubuntu-latest
    steps: 
    #- name: Python Dependency Installation
    #  # You may pin to the exact commit or the version.
    #  # uses: py-actions/py-dependency-install@3c3cdbee1f1761659b685ec4b146e0f4ac59e9b4
    #  uses: py-actions/py-dependency-install@v2.1.0
    #  with:
    #    # Path to requirements.txt file
    #    path: # optional, default is requirements.txt
    #    # Boolean for pip upgrade prior to the dependency installation (default='true')
    #    update-pip: # optional, default is true
    #    # Boolean for setuptools install/upgrade prior to the dependency installation (default='true')
    #    update-setuptools: false # optional, default is true
    #    # Boolean for wheel install/upgrade prior to the dependency installation (default='true')
    #    update-wheel: # optional, default is true    #- name: Python Unit Test
    #  # You may pin to the exact commit or the version.
    #  # uses: onichandame/python-test-action@6a1d618300de7ea0b753e50819e093a7e5a5f60b
    - name: Python Unit Test
      uses: onichandame/python-test-action@0.0.0
      with:
       pattern: Test.py
       deps_list: /github/home/requirements.txt
    #  #  test_dir: ${{ github.GITHUB_WORKSPACE }}/PythonBackup

I'm on a bit o fa time constraint to get this working, its important to my grade 😓

@onichandame
Copy link
Owner

The first thing I noticed on your yaml is the lack of some setup steps. In the readme of this action I put up a working example:

name: Test
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master # THIS IS IMPORTANT
      - uses: actions/setup-python@v2 # THIS IS IMPORTANT
        with:
          python-version: '3.8'
      - name: Test
        uses: onichandame/python-test-action@master
        with:
          deps_list: 'requirement'

Basically the checkout step pull your code from GitHub to the runner, and the setup-python step installs the required python environment on the runner.

Would you retry with the 2 steps mentioned above and see if it works?

@cgbsu
Copy link
Author

cgbsu commented Mar 30, 2021

Thank you, I think that worked, I am unsure if this is related, but I am now getting this problem

  gcc -shared -Wl,--as-needed -Wl,--as-needed build/temp.linux-x86_64-3.8/pandas/_libs/testing.o -L/usr/lib -o build/lib.linux-x86_64-3.8/pandas/_libs/testing.cpython-38-x86_64-linux-gnu.so
  building 'pandas._libs.window.aggregations' extension
  creating build/temp.linux-x86_64-3.8/pandas/_libs/window
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DNPY_NO_DEPRECATED_API=0 -Ipandas/_libs/window -I./pandas/_libs -I/tmp/pip-build-env-eihmhxeq/overlay/lib/python3.8/site-packages/numpy/core/include -I/usr/include/python3.8 -c pandas/_libs/window/aggregations.cpp -o build/temp.linux-x86_64-3.8/pandas/_libs/window/aggregations.o
gcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pandas
  Building wheel for numpy (PEP 517): started
  Building wheel for numpy (PEP 517): still running...
  Building wheel for numpy (PEP 517): still running...
  Building wheel for numpy (PEP 517): still running...
  Building wheel for numpy (PEP 517): finished with status 'done'
  Created wheel for numpy: filename=numpy-1.20.2-cp38-cp38-linux_x86_64.whl size=14967430 sha256=29728b7a5bc693df9d66d66424938671c57592f6f0512e03f3618b0ceba9cad9
  Stored in directory: /github/home/.cache/pip/wheels/bc/96/5b/bf957c3e1f5939c28bac37a163dc798bdbac8edd2cb342a513
Successfully built numpy
Failed to build pandas
ERROR: Could not build wheels for pandas which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 19.2.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
E
======================================================================
ERROR: Test (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: Test
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/github/workspace/Test.py", line 1, in <module>
    from Base import *
  File "/github/workspace/Base.py", line 1, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'


----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)

I searched for what to do with
gcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory I found this one of the answers (and a similar answer to a similar question) recommended installing g++, so I tried to make sure it was installed by adding a Setup C++ environment step

name: Lint And Unit Tests

on: [push]

jobs:
  linter:
    runs-on: ubuntu-latest
    steps:
    - name: Setup C++ environment
      # You may pin to the exact commit or the version.
      # uses: kurocha/setup-cpp@ef637353b9bec350da9c1088b73d2217d2441696
      uses: kurocha/setup-cpp@v1
    - uses: actions/checkout@master # THIS IS IMPORTANT
    - uses: actions/setup-python@v2 # THIS IS IMPORTANT
      with:
        python-version: '3.8'
    - name: GitHub Action for pylint
      # You may pin to the exact commit or the version.
      # uses: cclauss/GitHub-Action-for-pylint@8ef4d22e119fb1cdc0f58f2e95cb1f8d8b0d55e6
      uses: cclauss/GitHub-Action-for-pylint@0.7.0
  unit_tests:
    runs-on: ubuntu-latest
    steps: 
    - name: Setup C++ environment
      # You may pin to the exact commit or the version.
      # uses: kurocha/setup-cpp@ef637353b9bec350da9c1088b73d2217d2441696
      uses: kurocha/setup-cpp@v1
    - uses: actions/checkout@master # THIS IS IMPORTANT
    - uses: actions/setup-python@v2 # THIS IS IMPORTANT
      with:
        python-version: '3.8'
    - name: Python Unit Test
      uses: onichandame/python-test-action@0.0.0
      with:
       pattern: Test.py
    #  #deps_list: requirements.txt
    #  #  test_dir: ${{ github.GITHUB_WORKSPACE }}/PythonBackup

The accepted answer states that certain python packages should be installed, so I am unsure if it is related or not?

@onichandame
Copy link
Owner

The log is suggesting missing dependencies. It may be related to #1 which found a similar problem but with scipy.

Although the problem may be beyond this action's capability, I can give some advice if you provide a reproducing public repo that I can fork and experiment with.

Btw, the setup C++ step does not seem to install g++, it uses clang instead. Not sure if this caused the problem. The recommended package and the commands to install them can be found here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants