Comments (7)
@pemensik, what library are you trying to test? leapp-repository shared or actor library? If so, in such a library you need to include leapp framework python modules.
If you run pytest in any folder within leapp-repository directory structure, it picks up the pytest configuration file leapp-repository/conftest.py
which calls the leapp framework to load the leapp-repository.
Are you suggesting to make the conftest.py smarter and not call the leapp framework when you try run pytest x.py
where the x.py does not include anything leapp framework-related?
from leapp-repository.
@examon, I've created RHELLEAPP-1869 to deal with this. On top of backlog ;)
from leapp-repository.
I am trying to test my own bind configuration parser. It is much faster to test basic library in separate test. It is also much faster to debug it. Then without modification, test it as leapp library in second step.
I would suggest to move framework initialization into separate module. Make for example import leapp.test, which would initialize complete environment. Not only it always configures leapp. Problem is it cannot handle exception in its configuration, even no single leapp module was imported. Or try to hook it into leapp module. If any submodule is imported, it is fine. But it should not block simple scripts, where such failure is not an error.
I think it should trigger error only on loading leapp namespaces provided by leapp-repository. Maybe it could define function for repo initialization, which would change some value in leapp.actor and/or leapp.libraries.actor module? It would be called for any importing such modules, but would be skipped for unrelated scripts.
from leapp-repository.
@pemensik, can I close the issue based on #367?
from leapp-repository.
Seems like done.
from leapp-repository.
No, actually that fix was just handbrake. It did not fix primary issue. It just provided a way to work around.
I have problem with import system of actors in project. It is hard to develop fragments of Actors on Fedora box, because no packages are provided. And unnecessary dependencies on repository itself. But I will open new issue when I am able to formulate better why I think current import path system is broken. For now, It is just difficult to use PYTHONPATH to have imports working. Why is there some virtual leapp.libraries.common, when such file is not directly provided?
More later
from leapp-repository.
Why is there some virtual leapp.libraries.common, when such file is not directly provided?
Not sure what do you mean by that. It's possible that I missed the point, so in case you find my point completely unrelated to the topic, just ignore it. But I believe this is better than write people they have to watch into the repository to find out what path they should use - instead of something you can refer simply and people can find it, doesn't matter name of repositories. Similar thing for actor. Imagine that every actor would need different import paths. Imagine you want the hierarchy structure of repositories. Why to use long nonsense imports? After time, I thing this is very elegant solution in regards to generic structure of leapp repositories.
But as I told, it's possible that I missed the point. Still, when you formulate properly your problem in a new issue, it will be easier to discuss it, fix it or find a way to improve the experience. But in case that imports are problematic, it's issue for leapp - not leapp-repository.
from leapp-repository.
Related Issues (20)
- CentOS 7,9 to Almalinux: missing named-user-options.conf HOT 7
- package leapp-upgrade-el7toel8-1:0.16.0-6.el7.elevate.8.noarch conflicts with leapp-upgrade-el8toel9 provided by leapp-upgrade-el8toel9-0.17.0-3.el8.noarch when upgrade almalinux 8 to 9 HOT 13
- Why does Leapp upgrade fails with 'NameError: global name 'dnf' is not defined' ? HOT 1
- NameError: global name 'dnf' is not defined HOT 1
- pes-events.json license HOT 5
- Leapp does not detect qemu64 CPU incompatibility with CentOS-9 HOT 4
- efibootmgr exit code 5 during leapp efi_finalization_fix HOT 2
- Unexpected format of target version: 7 HOT 3
- Enhancement: Support for luks encrypted root and non root filesystems HOT 6
- Leapp fails to detect all the ceph encrypted volumes HOT 1
- Current x86-64 microarchitecture is unsupported even though all flags are present HOT 14
- el8toel9: PostgreSQL upgrade warning even when using PostgreSQL 13 on EL8 HOT 1
- how to excluding a package during the upgrade process. HOT 1
- Package "X" from local repository "Y" has incorrect checksum HOT 5
- sysstat doesn't upgrade generated 7 data files correctly to 8 HOT 2
- Dependency Dashboard
- leapp preupgrade errors on OracleLinux 8 HOT 1
- leapp upgrade does not respect --target version HOT 3
- feature request: support custom content inside upgrade initramfs HOT 6
- "Detected custom leapp actors or files" false positive HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leapp-repository.