Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #301 from takluyver/new-bootstrap-dev
Development install for Flit itself
- Loading branch information
Showing
9 changed files
with
114 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Symlink install flit & flit_core for development. | ||
# Most projects can do the same with 'flit install --symlink'. | ||
# But that doesn't work until Flit is installed, so we need some bootstrapping. | ||
|
||
import argparse | ||
import logging | ||
import os | ||
from pathlib import Path | ||
import sys | ||
|
||
my_dir = Path(__file__).parent | ||
os.chdir(my_dir) | ||
sys.path.insert(0, 'flit_core') | ||
|
||
from flit_core import build_thyself | ||
from flit_core.inifile import LoadedConfig | ||
from flit.install import Installer | ||
|
||
ap = argparse.ArgumentParser() | ||
ap.add_argument('--user') | ||
args = ap.parse_args() | ||
|
||
logging.basicConfig(level=logging.INFO) | ||
|
||
# Construct config for flit_core | ||
core_config = LoadedConfig() | ||
core_config.module = 'flit_core' | ||
core_config.metadata = build_thyself.metadata_dict | ||
core_config.reqs_by_extra['.none'] = build_thyself.metadata.requires_dist | ||
|
||
install_kwargs = {'symlink': True} | ||
if os.name == 'nt': | ||
# Use .pth files instead of symlinking on Windows | ||
install_kwargs = {'symlink': False, 'pth': True} | ||
|
||
# Install flit_core | ||
Installer( | ||
my_dir / 'flit_core', core_config, user=args.user, **install_kwargs | ||
).install() | ||
print("Linked flit_core into site-packages.") | ||
|
||
# Install flit | ||
Installer.from_ini_path( | ||
my_dir / 'pyproject.toml', user=args.user, **install_kwargs | ||
).install() | ||
print("Linked flit into site-packages.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Developing Flit | ||
=============== | ||
|
||
To get a development installation of Flit itself:: | ||
|
||
git clone https://github.com/takluyver/flit.git | ||
cd flit | ||
python3 -m pip install docutils requests pytoml | ||
python3 bootstrap_dev.py | ||
|
||
This links Flit into the current Python environment, so you can make changes | ||
and try them without having to reinstall each time. | ||
|
||
Testing | ||
------- | ||
|
||
To run the tests in separate environments for each available Python version:: | ||
|
||
tox | ||
|
||
`tox <https://tox.readthedocs.io/en/latest/>`_ has many options. | ||
|
||
To run the tests in your current environment, run:: | ||
|
||
pytest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters