library code for multiple python functions?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- build-system
Research direction
Start by reviewing project.yml and the per-function packages/servers/get_servers/build.sh and put_server/build.sh files, then compare them with lib/lib/pyproject.toml and its src/lib modules. Determine which shared-library approach the project should demonstrate and document it with an example covering both functions; done means a newcomer can follow the example to build functions that reuse the common code.
Written by the indexing model from the issue text.
Description
Suppose we have multiple functions that would share common, library code -- I'm sure this is a very common situation.
I currently ended up writing a minimal python project inside "lib" (the python package is also, inaptly, named lib -- apologies). I've ended up with a structure similar to the following:
.
├── .env
├── .gitignore
├── lib
│ └── lib
│ ├── pyproject.toml
│ └── src
│ └── lib
│ ├── __init__.py
│ ├── db.py
│ └── rest.py
├── packages
│ └── servers
│ ├── get_servers
│ │ ├── __deployer__.zip
│ │ ├── __main__.py
│ │ ├── build.sh
│ │ └── virtualenv
│ └── put_server
│ ├── __deployer__.zip
│ ├── __main__.py
│ ├── build.sh
│ └── virtualenv
└── project.yml
and each function's build.sh roughly doing
virtualenv --without-pip virtualenv
pip install ../../../lib/lib --target virtualenv/lib/python3.9/site-packages
Is there a better way? Could you add an example (or alter an existing example) with how to best achieve this?
- Dominant language
- Python
- Stars
- 33
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main Openarea: ci bug perceived difficulty: 3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ClickHouse/clickhouse-connect#1057 ·