Skip to content

Instantly share code, notes, and snippets.

@kourbou
Created December 15, 2020 20:47
Show Gist options
  • Select an option

  • Save kourbou/8566fe8cddbf73225d0f3c4f20de7777 to your computer and use it in GitHub Desktop.

Select an option

Save kourbou/8566fe8cddbf73225d0f3c4f20de7777 to your computer and use it in GitHub Desktop.
`poppler-utils` on 64-bit Windows
import shutil
from pathlib import Path
from conda.cli.python_api import Commands, run_command
PACKAGE_NAME = 'poppler'
PACKAGE_VERSION = '20.12.1'
PACKAGE_ENV_DIR = './poppler-env/'
def conda(*args, **kwargs):
stdout, _, _ = run_command(*args, **kwargs)
return stdout
def create_package_env():
print(conda(Commands.CREATE, '-c', 'conda-forge', '-p', PACKAGE_ENV_DIR,
PACKAGE_NAME + '=' + PACKAGE_VERSION))
if __name__ == "__main__":
create_package_env()
dest = f'{PACKAGE_NAME}-{PACKAGE_VERSION}'
print(f'Generating .zip archive for {dest}')
env_dir = Path(PACKAGE_ENV_DIR)
shutil.make_archive(dest, 'zip', env_dir / 'Library' / 'bin')
shutil.rmtree(env_dir)
@ECHO OFF
curl.exe https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -O
START /WAIT "" Miniconda3-latest-Windows-x86_64.exe /InstallationType=JustMe /AddToPath=0 /RegisterPython=0 /NoRegistry=1 /S /D=%CD%\Miniconda3
CALL Miniconda3\Scripts\activate.bat
python.exe fetch_poppler.py
REM Cleanup.
RD /S /Q Miniconda3
DEL Miniconda3-latest-Windows-x86_64.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment