Skip to content

Instantly share code, notes, and snippets.

@msarahan
msarahan / DependencyGraphs.ipynb
Last active November 21, 2023 12:59
graphs from conda repodata.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@epruesse
epruesse / render_env.py
Last active July 12, 2018 19:39 — forked from ericdill/render_env.py
Render the dependency graph for your conda environment (needs graphviz!)
import json
import glob
from os.path import join, basename, dirname
from os import getcwd
from sys import argv
# install this with "conda install -c conda-forge python-graphviz"
try:
import graphviz as gv
except ImportError:
print("Missing graphviz python module. Install using:")
@arose13
arose13 / install-conda.sh
Last active February 18, 2024 12:20
Install Miniconda in Ubuntu
# Setup Ubuntu
sudo apt update --yes
sudo apt upgrade --yes
# Get Miniconda and make it the main Python interpreter
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p ~/miniconda
rm ~/miniconda.sh
export PATH=~/miniconda/bin:$PATH
@ericdill
ericdill / render_env.py
Last active October 20, 2021 20:22
Render the dependency graph for your conda environment (needs graphviz!)
import json
import glob
import os
from os.path import join, basename
# install this with "conda install -c conda-forge python-graphviz"
import graphviz as gv
# path to your conda environment
path = os.environ.get('CONDA_PREFIX')
if path is None:
@zshaheen
zshaheen / travis_to_conda.md
Last active May 28, 2021 18:15
How to Setup Automatic Uploads to Anaconda from Travis CI in 15 minutes

How to Setup Automatic Uploads to Anaconda from Travis CI in 15 minutes

TL;DR: Edit .travis.yaml to install Anaconda and to run conda_upload.sh after testing. Edit meta.yaml to take in the environmental variables $VERSION and $CONDA_BLD_PATH. Create conda_upload.sh which sets the needed environmental variables, builds the tar archive, and uploads it to Anaconda. Finally edit some stuff on your Anaconda and Travis CI account so they can talk.

Intro

The following steps will detail how to automatically trigger Anaconda builds and uploads from Travis CI. This will only upload successful builds in the master branch and if there are multiple commits in a single day, it'll only keep the latest one. Both of these settings can easily be changed.

Edit .travis.yaml

First, edit .travis.yml so that it installs Anaconda.

install:
from PyQt5.QtWidgets import QDialog, QProgressBar, QLabel, QHBoxLayout
from PyQt5.QtCore import pyqtSlot
class ProgressBar_Dialog(QDialog):
def __init__(self):
super(ProgressBar_Dialog ,self).__init__()
self.init_ui()
def init_ui(self):
# Creating a label
from click import command, option, Option, UsageError
class MutuallyExclusiveOption(Option):
def __init__(self, *args, **kwargs):
self.mutually_exclusive = set(kwargs.pop('mutually_exclusive', []))
help = kwargs.get('help', '')
if self.mutually_exclusive:
ex_str = ', '.join(self.mutually_exclusive)
kwargs['help'] = help + (
@Jaza
Jaza / Private-pypi-howto
Last active July 2, 2023 16:24
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
*
@dberzano
dberzano / CMakeLists.txt
Created January 28, 2015 11:11
CMake: how to use optional arguments in macros and how to escape/unescape args to a shell
cmake_minimum_required(VERSION 2.8)
project(testoptargsandescape)
macro(testmacro testarg1 testarg2)
message(STATUS "testarg1 = \"${testarg1}\"")
message(STATUS "testarg2 = \"${testarg2}\"")
message(STATUS "Optional arg = \"${ARGV2}\"")
@adrienbrault
adrienbrault / purge.sh
Created September 24, 2012 10:02
Script to reduce VM size before packaging for vagrant
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5