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

Error when trying to install cocoex from development #2230

Closed
brockho opened this issue Nov 4, 2023 · 13 comments
Closed

Error when trying to install cocoex from development #2230

brockho opened this issue Nov 4, 2023 · 13 comments
Assignees

Comments

@brockho
Copy link
Contributor

brockho commented Nov 4, 2023

I am still unsure how to install the cocoex module after the recent changes in the development branch. I tried to follow the instructions in .github/workflows/build.yml and the call python -m pip install --upgrade -r scripts/requirements.txt already gives an error on my machine (Windows 10 with Anaconda Python, version 3.9.7:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
spyder 5.1.5 requires pyqt5<5.13, which is not installed.
spyder 5.1.5 requires pyqtwebengine<5.13, which is not installed.

@olafmersmann: are there some requirements missing?

@olafmersmann
Copy link
Contributor

olafmersmann commented Nov 4, 2023

Following these steps should install cocoex:

  1. Create or update a new conda environment with all the requirements by running

    conda env create -f env.yaml

    or

    conda env update -f env.yaml --prune
  2. Activate environment

    conda activate coco
  3. Fabricate all the artifacts needed (needs to be rerun every time the C sources change).

    python scripts/fabricate
  4. Install the cocoex package

    python -m pip install code-experiments/build/python/ 

All of this assumes that you have a working development environment (C compiler etc.) installed. You could add these to the Anaconda environment if not installed already.

@olafmersmann olafmersmann self-assigned this Nov 4, 2023
@olafmersmann
Copy link
Contributor

I am still unsure how to install the cocoex module after the recent changes
in the development branch. I tried to follow the instructions in

.github/workflows/build.yml

and the call

python -m pip install --upgrade -r scripts/requirements.txt

already gives an error on my machine

Those should be enough. They work on Windows in CI builds. See f.e. this run of the build workflow and esp. the Python 3.9 Windows build.

@brockho
Copy link
Contributor Author

brockho commented Nov 5, 2023

Many thanks, @olafmersmann, for your explications. It works now. I had, though, to exchange python scripts/fabricate.py (the file does not exist) with python scripts/fabricate to make it work. I already corrected your explanations above accordingly.

@olafmersmann
Copy link
Contributor

Can we mark this as resolved?

@brockho
Copy link
Contributor Author

brockho commented Nov 10, 2023

Can we mark this as resolved?

Yes :-)

@brockho brockho closed this as completed Nov 10, 2023
@ttusar
Copy link
Contributor

ttusar commented Nov 10, 2023

@olafmersmann Could you also explain how to run the tests locally?

@ttusar ttusar reopened this Nov 10, 2023
@olafmersmann
Copy link
Contributor

Before you begin testing, always run python scripts/fabricate to update any auto-generated files.

Unit tests

Change to the unit tests directory

cd code-experiments/test/unit-test

Rerun fabricate if not already done

python ../../../scripts/fabricate

Build tests using cmake

cmake -B build
cmake --build build

Run tests using ctest

ctest --test-dir build     

Regression tests

Note that I'm not sure the regression tests are really useful at the moment. But here goes:

Change to the regression tests directory

cd code-experiments/test/regression-test

The regression tests require the cocoex Python package. Install it first

pip uninstall -y cocoex
pip install ../../build/python/  

Now run the regression tests

python test_suites.py   

and

python test_logger.py

Integration tests

Still need to fix those up.

cocoex Python package

Change to the cocoex Python package directory

cd code-experiments/build/python

Install the package from source

pip uninstall -y cocoex
pip install .

Install and run pytest

pip install pytest
python -m pytest test

@ttusar
Copy link
Contributor

ttusar commented Nov 10, 2023

Many thanks! I propose to keep this issue open until these instructions are available in one of the readmes.

@brockho
Copy link
Contributor Author

brockho commented Nov 16, 2023

@olafmersmann, I have now problems to install the cocopp package from the development branch. Would you be so kind and explain how to do? I tried things like python -m pip install .\code-postprocessing\cocopp\ but there is no setup.py file anywhere anymore.

@olafmersmann
Copy link
Contributor

olafmersmann commented Nov 17, 2023

Before you begin, always run python scripts/fabricate to update any auto-generated files. Then, you can install the cocopp package using pip:

python -m pip uninstall -y cocopp
python -m pip install code-postprocessing

If you are working on cocopp, you can use an editable install and Python will pick up any changes you make without having to reinstall:

python -m pip uninstall -y cocopp
python -m pip install --editable code-postprocessing

olafmersmann added a commit that referenced this issue Nov 17, 2023
Since switching away from do.yp to scripts/fabricate, the developer
experience has changed drastically. This commit starts adding more
formal documentation on how a developer interacts with the code
base.

Resolves #2230
Partially fixes #2238
olafmersmann added a commit that referenced this issue Nov 17, 2023
Since switching away from do.yp to scripts/fabricate, the developer
experience has changed drastically. This commit starts adding more
formal documentation on how a developer interacts with the code
base.

Resolves #2230
Partially fixes #2238
olafmersmann added a commit that referenced this issue Nov 17, 2023
Since switching away from do.yp to scripts/fabricate, the developer
experience has changed drastically. This commit starts adding more
formal documentation on how a developer interacts with the code
base.

Resolves #2230
Partially fixes #2238
olafmersmann added a commit that referenced this issue Nov 17, 2023
Since switching away from do.yp to scripts/fabricate, the developer
experience has changed drastically. This commit starts adding more
formal documentation on how a developer interacts with the code
base.

Resolves #2230
Partially fixes #2238
olafmersmann added a commit that referenced this issue Nov 17, 2023
Since switching away from do.yp to scripts/fabricate, the developer
experience has changed drastically. This commit starts adding more
formal documentation on how a developer interacts with the code
base.

Resolves #2230
Partially fixes #2238
@nikohansen
Copy link
Contributor

Could you provide a link where I can find the essence of this information in the docs/help for COCO?

@olafmersmann
Copy link
Contributor

Have a look at DEVELOPMENT.md in the development branch. If something is missing, don't hesitate to create a new issue or ask here and I'll add more instructions.

FMGS666 pushed a commit that referenced this issue Nov 22, 2023
Since switching away from do.yp to scripts/fabricate, the developer
experience has changed drastically. This commit starts adding more
formal documentation on how a developer interacts with the code
base.

Resolves #2230
Partially fixes #2238
FMGS666 pushed a commit that referenced this issue Nov 25, 2023
Since switching away from do.yp to scripts/fabricate, the developer
experience has changed drastically. This commit starts adding more
formal documentation on how a developer interacts with the code
base.

Resolves #2230
Partially fixes #2238
@ttusar
Copy link
Contributor

ttusar commented Jan 25, 2024

Regarding the first step of the installation (Create or update a new conda environment with all the requirements). Is there an easy way of updating an existing conda environment that is not called coco? This would come in handy when one already has an environment set up and just wants to install cocoex into it.

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

4 participants