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

Add support for more Operating systems #16

Open
blavejr opened this issue Oct 22, 2017 · 15 comments
Open

Add support for more Operating systems #16

blavejr opened this issue Oct 22, 2017 · 15 comments

Comments

@blavejr
Copy link
Owner

blavejr commented Oct 22, 2017

Currently the program only works for windows, if anyone could add support for more operating systems that would be highly appreciated. Mac OS, Ubuntu etc.. anything you are comfortable with. :)

@joeryan
Copy link
Contributor

joeryan commented Oct 25, 2017

I will take a look and see what I might be able to help with.

@blavejr
Copy link
Owner Author

blavejr commented Oct 25, 2017

@joeryan Great man that would be highly appreciated. 👍

@angshumukherjee100
Copy link

Hey @blavejr
I would try to add support for Ubuntu.

@blavejr
Copy link
Owner Author

blavejr commented Nov 13, 2017

@angshumukherjee100 that would be great man, give it a crack.

@Rohithgilla12
Copy link

Rohithgilla12 commented Feb 23, 2018

Hey is this issue still open?
I would like to take it up for ubuntu

@thedevtoolsmith
Copy link

Hi is the project still active?
I would like to add support for MacOS

@ghost
Copy link

ghost commented Jan 5, 2020

Would love to add support for Linux (Ubuntu), let me know if this is still open.

@blavejr
Copy link
Owner Author

blavejr commented Jan 8, 2020

Hi @safderareepattamannil I think someone added support for Linux a while back but it could also have been for mac? I am not sure but right now I am sure that it runs on Windows and Mac, but what you could do is try and run it on your flavour of Linux and see what happens.

I think its just a check somewhere for the os, I haven't looked at the code for a while tbh.

@ghost
Copy link

ghost commented Jan 8, 2020

@blavejr , sure thing, I'll check on Linux and get back to you to confirm.

@KokoseiJ
Copy link
Collaborator

Fedora user here, I'll also take a look at the code to see if I can provide any help.

@chaps
Copy link
Contributor

chaps commented Aug 31, 2020

This might be something to start with these platform support tasks in order
to avoid performing OS checks for concatenating the OS filesystem paths:
#89

@KokoseiJ
Copy link
Collaborator

Oh, yeah, I overlooked that part...

Got it, merging it right away.

@un1u3
Copy link

un1u3 commented Oct 2, 2022

Okie

@ghost
Copy link

ghost commented Apr 13, 2023

Saw the issue was still open... Any help needed on support/testing for macOS or is that already added?

The specs of my Macbook.

@PARTHIB-DEB
Copy link

Solutions for the Multiple OS support problem #16

Hey I am Parthib , here are my 2 solutions -

TOX

  • It's a Python library that is used to make a python project suitable accross all of its different versions and all types os. It focuses the problem "But it runs on my machine" , specially for Python. You can create a Tox file by tox.ini or pyproject.toml or setup.cfg. Although , I would suggest tox.ini is the best. If you have used pytest before , then you will get a similarity in making the tox.ini config file. Here is a demo description of tox.ini
[tox]
envlist = py38, py39, py310

[testenv]
deps = 
    pytest
commands = 
    pytest

[testenv:windows]
platform = win32
deps = 
    pytest
commands = 
    pytest

[testenv:linux]
platform = linux
deps = 
    pytest
commands = 
    pytest

[testenv:mac]
platform = darwin
deps = 
    pytest
commands = 
    pytest

As you can see it not only supports different python versions , but different OS and which command will be stacked in each of them. In short , you can consider it similar to makefile

PLATFORM

  • It's a Python library that is directly maintained by PSF. By implementing this library , you can hardcode functionalities for each OS inside a python code. Unlike TOX , you don't have to make a seperate config file. But I will suggest if you want to strongly handle different OS, use TOX and PLATFORM as a team.
    Here is a demo of the duo -
# setup_env.py

import platform
import os

def set_os_env():
    os_name = platform.system().lower()
    if os_name.startswith('win'):
        os.environ['TOX_ENV_NAME'] = 'windows'
    elif os_name.startswith('linux'):
        os.environ['TOX_ENV_NAME'] = 'linux'
    elif os_name.startswith('darwin'):
        os.environ['TOX_ENV_NAME'] = 'mac'

if __name__ == "__main__":
    set_os_env()

[tox]
envlist = py38, py39, py310

[testenv]
deps = 
    pytest
commands = 
    python setup_env.py
    pytest

[testenv:windows]
platform = win32
setenv =
    TOX_ENV_NAME = windows
deps = 
    pytest
commands = 
    pytest

[testenv:linux]
platform = linux
setenv =
    TOX_ENV_NAME = linux
deps = 
    pytest
commands = 
    pytest

[testenv:mac]
platform = darwin
setenv =
    TOX_ENV_NAME = mac
deps = 
    pytest
commands = 
    pytest

Here you can see , based on the each OS 'TOX_ENV_NAME' environment variable got different values and TOX is supervising everything

If you have liked my answer , give this a ❤️

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

No branches or pull requests

9 participants