Gitlab runner clones a dirty version when using LFS

Hello. I have a project with binary large files stored using LFS, and was trying to deploy to PyPI using the gitlab-runner. The problem I was facing is that as soon as the repository is cloned by the runner, it is immediately dirty, indicating that the LFS-stored files have changes.
After some digging, I found out that git-lfs is not actually installed on the runner, and I assume that the files are downloaded in some other way, making git think that they have changed. Finally, my solution was to bypass this procedure using the GIT_LFS_SKIP_SMUDGE: "1" variable, downloading and installing git-lfs and using git lfs pull to get the large files. This way, the local version was still clean and I could use it to deploy.

Here is the relevant part of the .gitlab-ci.yml script:

  stage: deploy
  image: python:3.5
    - pip install --upgrade pip setuptools wheel twine
    - curl -L | tar xz
    - pushd git-lfs-1.4.1
    - ./
    - popd
    - rm -rf git-lfs-1.4.1
    - git lfs pull
    - python sdist bdist_wheel
    - twine upload --username=$PYPI_USERNAME --password=$PYPI_PASSWORD --skip-existing dist/*
  - tags