MikaLendingBot icon indicating copy to clipboard operation
MikaLendingBot copied to clipboard

Reorganise directory structure

Open laxdog opened this issue 7 years ago • 3 comments

I'm not 100% sure of the best way to do this, but at the least we should have all of the installable files in one directory. This will allow us to host on PyPi and mean we can remove the hack to get pytest working.

My initial thoughts on the layout are that it should look like this:

├── LICENSE
├── README.md
├── default.cfg.example
├── docs
│   └── docs
├── poloniexlendingbot
│   ├── lendingbot.py
│   ├── market_data
│   │   └── readme.txt
│   ├── modules
│   │   └── modules
│   ├── tests
│   │   └── tests
│   └── www
│       ├── images
│       │   └── images
│       └── www
├── requirements.txt
└── setup.py

One thing I don't think should be in there is the market_data folder. It will probably need to have a config option for it's path. Might be worth considering a folder in the user's home that we can put the config and market data in.

Having one single folder where all the actual code lives means we can use the setup.py (non-existent currently) to install that easily.

laxdog avatar Apr 24 '17 09:04 laxdog

  1. Having an internal 'poloniexlendingbot' folder is confusing, lets make it 'bot' or something else.
  2. market_data needs to go out, but lets keep it inside the main folder as "user's home" might be a world of pain cross platform.

Like the setup.py idea.

rnevet avatar Apr 28 '17 16:04 rnevet

  1. Agreed. What about src or something though?
  2. The problem with that is, if it's not an installed directory, we won't be able to know where it is. That's if we were to install with pip. I don't mind keeping it in there for the mean time and allowing people to change it with config, but it needs to live in the bot / src directory then.

I've also made a few changes around that stuff, so it's now using an sqlite db, not the txt files as before. So people are less likely to actually look at it, meaning it less troublesome to keep it in the install directory.

Other: a) Tests could maybe live at the top level too. b) the os module has a cross platform home dir : http://stackoverflow.com/a/4028943/7132871 c) Good post on hosting to PyPi here : https://www.codementor.io/arpitbhayani/host-your-python-package-using-github-on-pypi-du107t7ku

laxdog avatar Apr 28 '17 17:04 laxdog

Started this on the packaging branch

laxdog avatar Aug 04 '17 08:08 laxdog