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

Update Windows Tailwind executable download path #67

Closed
rtr1 opened this issue Nov 11, 2023 · 3 comments
Closed

Update Windows Tailwind executable download path #67

rtr1 opened this issue Nov 11, 2023 · 3 comments

Comments

@rtr1
Copy link

rtr1 commented Nov 11, 2023

Hello. When I run python .\manage.py tailwind runserver I get the message:

Tailwind CSS CLI not found.
Downloading Tailwind CSS CLI from 'https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.5/tailwindcss-windows-amd64'

Which errors with 404 not found. The download link in Tailwind Labs repository is:

https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.5/tailwindcss-windows-x64.exe

With the differences being:

  • x64 instead of amd64
  • Includes .exe suffix

If I update these two functions it downloads the correct Tailwind CLI executable:

def get_system_and_machine(self) -> Tuple[str, str]:
    """Get the system and machine name."""
    system = platform.system().lower()
    if system == "darwin":  # pragma: no cover
        system = "macos"

    machine = platform.machine().lower()
    if machine == "x86_64" or 'amd64':  # pragma: no cover
        machine = "x64"
    elif machine == "aarch64":  # pragma: no cover
        machine = "arm64"

    return (system, machine)

def get_download_url(self) -> str:
    """Get the download url for the Tailwind CSS CLI."""
    system, machine = self.get_system_and_machine()
    extension = '.exe' if system == 'windows' else ''
    return (
        "https://github.com/tailwindlabs/tailwindcss/releases/download/"
        f"v{self.tailwind_version}/tailwindcss-{system}-{machine}{extension}"
    )

With the changes being:

  • Add or 'amd64' to if machine == "x86_64" or 'amd64':
  • Add extension = '.exe' if system == 'windows' else ''
  • Update the f-string to include the {extension}

I'm using Python 3.11.3 64-bit on Windows 11 with Django 4.2.4

@oryon-dominik
Copy link

It also has issues recognizing tailwindcss.exe when installed via scoop (linked in ~/scoop/shims/ by default)

@oliverandrich
Copy link
Owner

@rtr1 I plan to work on this issue on Friday. I would be happy to see someone let the test suite run on Windows, as I only have Macs and Linux machines at hand. Could you do this for me?

@oliverandrich
Copy link
Owner

@oryon-dominik I think you are referencing to the same topic as Jeff did in his discussion entry (#65). I plan to add the functionality to reference an externally installed CLI. I will create a seperate ticket for this.

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

3 participants