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

dependencies are duplicated + add version specs #5

Closed
JarbasAl opened this issue Nov 4, 2021 · 4 comments · Fixed by #15
Closed

dependencies are duplicated + add version specs #5

JarbasAl opened this issue Nov 4, 2021 · 4 comments · Fixed by #15
Labels
good first issue Good for newcomers

Comments

@JarbasAl
Copy link
Member

JarbasAl commented Nov 4, 2021

dependencies are duplicated in setup.py and requirements.txt. Also, should add version specs to all deps

@ChanceNCounter ChanceNCounter added the good first issue Good for newcomers label Nov 7, 2021
@builderjer
Copy link
Member

I can help on this. Which file should they be in?

@NeonDaniel
Copy link
Member

In OSM, we put them in setup.py and requirements.txt just included . to install from setup.py
I think that's the best option for consistency? @ChanceNCounter did that one iirc
https://github.com/OpenVoiceOS/ovos_skill_manager

@ChanceNCounter
Copy link
Contributor

To be honest, I did about 10 minutes of research, another 10 minutes of trying to break it, and concluded that StackOverflow was right this time. I have no idea if that's a best practice or a kludge.

@NeonDaniel
Copy link
Member

NeonDaniel commented Feb 4, 2022

Alternate method I started using (before I knew . was a valid requirement) below. One new nice side-effect is PyCharm validation of requirements files
https://github.com/NeonGeckoCom/neon-skill-utils/blob/e43adf3fe05774c031849c1a62b2cc6fe00a8556/setup.py#L34-L39

def get_requirements(requirements_filename: str):
    requirements_file = path.join(path.abspath(path.dirname(__file__)), "requirements", requirements_filename)
    with open(requirements_file, 'r', encoding='utf-8') as r:
        requirements = r.readlines()
    requirements = [r.strip() for r in requirements if r.strip() and not r.strip().startswith("#")]
    return requirements

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

Successfully merging a pull request may close this issue.

4 participants